forked from ministryofjustice/fb-metadata-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
41 lines (27 loc) · 1.24 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
36
37
38
39
40
41
FROM ruby:3.1.3-alpine3.16
ARG UID=1001
RUN apk add build-base postgresql-contrib postgresql-dev bash libcurl git
RUN apk add --no-cache gcompat
RUN addgroup -g ${UID} -S appgroup && \
adduser -u ${UID} -S appuser -G appgroup
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
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 chown appuser:appgroup ./rds-ca-bundle-root.crt
COPY --chown=appuser:appgroup Gemfile Gemfile.lock .ruby-version ./
RUN gem install bundler
ARG BUNDLE_ARGS='--jobs 2 --without test development'
RUN bundle install --no-cache ${BUNDLE_ARGS}
COPY --chown=appuser:appgroup . .
ENV APP_PORT 3000
EXPOSE $APP_PORT
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 bundle exec rake db:migrate:ignore_concurrent && bundle exec rails s -e ${RAILS_ENV} -p ${APP_PORT} --binding=0.0.0.0