-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
65 lines (51 loc) · 2.02 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
# Note: Uncomment this to run docker locally
# FROM agilesix/ruby:3.3.6
# Note: Comment out the next line to run docker locally
FROM 124858472090.dkr.ecr.us-gov-west-1.amazonaws.com/diffusion-marketplace:ruby-3.3.6
RUN groupadd wheel
RUN useradd -rm -d /home/nginx -s /bin/bash -g root -G wheel -u 1443 nginx
RUN groupadd -g 1443 nginx
RUN usermod -a -G nginx nginx
ARG S3_BUCKET_NAME
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ARG AWS_REGION
RUN git config --global http.sslVerify false
COPY install-certs.sh .
RUN bash install-certs.sh
RUN apt-get update && \
apt-get install -y ca-certificates
#COPY va-dc.crt /etc/pki/ca-trust/source/anchors/va-dc.crt
#COPY VA-Internal-S2-RCA2.cer /etc/pki/ca-trust/source/anchors/VA-Internal-S2-RCA2.cer
#RUN update-ca-trust extract
RUN apt-get update -qq \
&& apt-get install -y libpq-dev
RUN bundle config build.pg --with-pg-config=/usr/bin/pg_config
RUN gem install bundler --force
#RUN gem install bundler --force
#RUN bundle config build.pg --with-pg-config=/usr/pgsql-12/bin/pg_config
ENV RAILS_ROOT /home/nginx/app
ENV PROXY_ROOT /home/nginx/www
RUN mkdir -p $RAILS_ROOT && \
mkdir -p $PROXY_ROOT && \
mkdir -p $PROXY_ROOT/log && \
chown -R nginx:nginx /home/nginx
RUN chmod g+rwx $RAILS_ROOT && chmod g+rwx /home/nginx/www
# Set working directory
WORKDIR $RAILS_ROOT
# Setting env up
ENV RAILS_ENV='production'
ENV RACK_ENV='production'
# Adding gems
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN bundle config set without 'development test'
RUN bundle install --retry 3 --jobs 20
USER nginx
COPY --chown=nginx . .
RUN rm -rf config/credentials.yml.enc
RUN rm -rf config/master.key
RUN EDITOR="vim --wait" bundle exec rails credentials:edit > /dev/null 2>&1
RUN DB_ADAPTER=nulldb RAILS_ENV=production SES_SMTP_USERNAME=diffusion_marketplace SES_SMTP_PASSWORD=diffusion_marketplace bundle exec rails assets:precompile HOSTNAME=diffusion-marketplace.va.gov
EXPOSE 3000
CMD bash scripts/start_server.sh