-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathDockerfile.prd
More file actions
34 lines (24 loc) · 807 Bytes
/
Dockerfile.prd
File metadata and controls
34 lines (24 loc) · 807 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
FROM ruby:3.1.2-slim-bullseye AS base
ENV LANG=C.UTF-8 \
RAILS_ENV="production" \
BUNDLE_DEPLOYMENT="1" \
BUNDLE_PATH="/usr/local/bundle"
WORKDIR /app
FROM base AS builder
RUN apt-get update -qq && \
apt-get install -y build-essential libpq-dev && \
rm -rf /var/lib/apt/lists/*
COPY Gemfile Gemfile.lock ./
RUN bundle install --jobs "$(nproc)" --without development test && \
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
COPY . .
FROM base AS runner
RUN apt-get update -qq && \
apt-get install -y libpq-dev && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/bundle /usr/local/bundle
COPY --from=builder /app /app
COPY db/csv /app/db/csv
RUN chmod +x bin/start.sh
EXPOSE ${PORT:-8080}
CMD ["bin/start.sh"]