-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
84 lines (69 loc) · 1.93 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM ruby:3.3.5-bullseye
ARG BUILD_NUMBER
ARG GIT_BRANCH
ARG GIT_REF
RUN \
set -ex \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install \
-y \
--no-install-recommends \
locales \
&& sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG=en_GB.UTF-8
ENV \
LANG=en_GB.UTF-8 \
LANGUAGE=en_GB.UTF-8 \
LC_ALL=en_GB.UTF-8
ARG VERSION_NUMBER
ARG COMMIT_ID
ARG BUILD_DATE
ARG BUILD_TAG
ENV APPVERSION=${VERSION_NUMBER}
ENV APP_GIT_COMMIT=${COMMIT_ID}
ENV APP_BUILD_DATE=${BUILD_DATE}
ENV APP_BUILD_TAG=${BUILD_TAG}
WORKDIR /app
RUN \
set -ex \
&& apt-get install \
-y \
--no-install-recommends \
apt-transport-https \
build-essential \
libpq-dev \
netcat \
apt-utils \
nodejs \
iputils-ping\
&& timedatectl set-timezone Europe/London || true \
&& gem update bundler --no-document
RUN \
set -ex \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN \
set -ex \
&& apt-get update \
&& apt-get install \
-y \
--no-install-recommends \
yarn=1.10.1-1 \
&& yarn add govuk-frontend
COPY Gemfile Gemfile.lock ./
RUN bundle update --bundler
RUN bundle config set without 'development test'
RUN bundle install --jobs 2 --retry 3
COPY . /app
ENV BUILD_NUMBER=${BUILD_NUMBER}
ENV GIT_BRANCH=${GIT_BRANCH}
ENV GIT_REF=${GIT_REF}
RUN mkdir -p /home/appuser && \
useradd appuser -u 1001 --user-group --home /home/appuser && \
chown -R appuser:appuser /app && \
chown -R appuser:appuser /home/appuser
USER 1001
RUN bundle update --bundler
RUN SECRET_KEY_BASE=`rails secret` PUBLIC_SERVICE_URL=http://example.com RAILS_ENV=production STAFF_SERVICE_URL=http://example.com SERVICE_URL=http://example.com rails assets:precompile --trace
EXPOSE 3000