-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.erb
29 lines (22 loc) · 931 Bytes
/
Dockerfile.erb
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
FROM <%= ENV['FROM_IMAGE'] %>
# Cleanup expired Let's Encrypt CA (Sept 30, 2021)
RUN sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf && update-ca-certificates -f
<% rubygems_version = ENV['RUBYGEMS_VERSION'] %>
<%= "RUN gem update --system #{rubygems_version}" unless rubygems_version.empty? %>
# Install prerequisites
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y runit nginx nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Prepare application directory
RUN mkdir /app
WORKDIR /app
# Adding scripts and configuration files
ADD files/runit-bootstrap /usr/local/sbin/runit-bootstrap
ADD files/runit-nginx-run /etc/service/nginx/run
ADD files/nginx-app.conf /etc/nginx/sites-enabled/app.conf
RUN rm /etc/nginx/sites-enabled/default
# Set environment and expose port
ENV RAILS_ENV production
EXPOSE 80
CMD ["/usr/local/sbin/runit-bootstrap"]