-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
26 lines (18 loc) · 620 Bytes
/
Dockerfile
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
ARG ruby_version=3.2
ARG base_image=ghcr.io/alphagov/govuk-ruby-base:$ruby_version
ARG builder_image=ghcr.io/alphagov/govuk-ruby-builder:$ruby_version
FROM --platform=$TARGETPLATFORM $builder_image AS builder
WORKDIR $APP_HOME
COPY Gemfile* .ruby-version ./
RUN bundle install
COPY . .
RUN bootsnap precompile --gemfile .
RUN rails assets:precompile && rm -fr log
FROM --platform=$TARGETPLATFORM $base_image
ENV GOVUK_APP_NAME=static
WORKDIR $APP_HOME
COPY --from=builder $BUNDLE_PATH $BUNDLE_PATH
COPY --from=builder $BOOTSNAP_CACHE_DIR $BOOTSNAP_CACHE_DIR
COPY --from=builder $APP_HOME .
USER app
CMD ["puma"]