-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.example
More file actions
41 lines (31 loc) · 839 Bytes
/
Copy pathDockerfile.example
File metadata and controls
41 lines (31 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Example Dockerfile for running Prescient gem applications
FROM ruby:3.4-alpine
# Install system dependencies
RUN apk add --no-cache \
build-base \
curl \
git \
postgresql-dev \
tzdata
# Set working directory
WORKDIR /app
# Create non-root user
RUN addgroup -g 1000 -S appuser && \
adduser -u 1000 -S appuser -G appuser
# Copy Gemfile and Gemfile.lock
COPY Gemfile* ./
COPY prescient.gemspec ./
COPY lib/prescient/version.rb ./lib/prescient/
# Install gems
RUN bundle config --global frozen 1 && \
bundle install --jobs 4 --retry 3
# Copy application code
COPY . .
# Change ownership to appuser
RUN chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# Expose port (if running a web service)
EXPOSE 3000
# Default command
CMD ["bundle", "exec", "ruby", "examples/custom_contexts.rb"]