forked from alphagov/asset-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (29 loc) · 1.15 KB
/
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
27
28
29
30
31
32
33
34
35
# TODO: make this default to govuk-ruby once it's being pushed somewhere public
# (unless we decide to use Bitnami instead)
ARG base_image=ruby:2.7.6
FROM $base_image AS builder
# This image is only intended to be able to run this app in a production RAILS_ENV
ENV RAILS_ENV=production
# TODO: have a separate build image which already contains the build-only deps.
RUN apt-get update -qy && \
apt-get upgrade -y && \
apt-get clean
RUN mkdir /app
WORKDIR /app
COPY Gemfile Gemfile.lock .ruby-version /app/
RUN bundle config set deployment 'true' && \
bundle config set without 'development test' && \
bundle install --jobs 4 --retry=2
COPY . /app
FROM $base_image
ENV RAILS_ENV=production GOVUK_APP_NAME=asset-manager GOVUK_ASSET_ROOT=http://assets-origin.dev.gov.uk
# TODO: apt-get upgrade in the base image
RUN apt-get update -qy && \
apt-get upgrade -y && \
# TODO: remove Clamav from container and run it as a seperate container
apt-get install -y clamav
RUN ln -sf /usr/bin/clamscan /usr/bin/govuk_clamscan && freshclam
WORKDIR /app
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
COPY --from=builder /app ./
CMD bundle exec puma