-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (33 loc) · 1.62 KB
/
Dockerfile
File metadata and controls
49 lines (33 loc) · 1.62 KB
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
42
43
44
45
46
47
48
49
FROM ruby:3.3.11-alpine
ARG UID=1001
RUN apk add git yarn build-base postgresql-contrib postgresql-dev bash libcurl curl yaml-dev
RUN apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ nodejs
ARG KUBE_VERSION="1.21.0"
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v$KUBE_VERSION/bin/linux/amd64/kubectl
RUN chmod u+x kubectl && mv kubectl /bin/kubectl
RUN addgroup -g ${UID} -S appgroup && \
adduser -u ${UID} -S appuser -G appgroup
RUN chown appuser:appgroup /bin/kubectl
WORKDIR /app
RUN chown appuser:appgroup /app
ADD --chown=appuser:appgroup https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem ./rds-ca-2019-root.pem
ADD --chown=appuser:appgroup https://s3.amazonaws.com/rds-downloads/rds-ca-2015-root.pem ./rds-ca-2015-root.pem
ADD --chown=appuser:appgroup https://truststore.pki.rds.amazonaws.com/eu-west-2/eu-west-2-bundle.pem ./eu-west-bundle.pem
RUN cat ./rds-ca-2019-root.pem > ./rds-ca-bundle-root.crt
RUN cat ./rds-ca-2015-root.pem >> ./rds-ca-bundle-root.crt
RUN cat ./eu-west-bundle.pem >> ./rds-ca-bundle-root.crt
RUN chown appuser:appgroup ./rds-ca-bundle-root.crt
COPY --chown=appuser:appgroup Gemfile Gemfile.lock .ruby-version ./
RUN gem install bundler
RUN bundle config set no-cache 'true'
RUN bundle config set without 'test development'
RUN bundle config set jobs '2'
RUN bundle install
COPY --chown=appuser:appgroup . .
USER ${UID}
# Govuk Publishing Components gem requires these env vars to be set, however we
# do not actually need to use them.
ENV GOVUK_APP_DOMAIN ''
ENV GOVUK_WEBSITE_ROOT ''
ARG RAILS_ENV=production
CMD bin/delayed_job run