-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.Dockerfile
56 lines (43 loc) · 1.74 KB
/
client.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
#
# BudgetTracker Dockerfile for UI
#
FROM ubuntu:latest
USER root
RUN apt-get update
RUN apt-get install -y curl nginx openssl nodejs build-essential
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update
RUN apt-get install -y yarn
# Remove the default Nginx configuration file
RUN rm -v /etc/nginx/nginx.conf
# Copy a configuration file from the current directory
ADD /client/nginx.conf /etc/nginx/
ADD /client/ /usr/share/nginx/
RUN yarn --version
RUN yarn add resclient
RUN cd /usr/share/nginx && yarn install
# node_modules is not in the web root because the idea is that dependencies are read-only during development.
# The symlink making in this Dockerfile may be redundant it the symlink remains in the repo.
# It exists in the repo for when you use "make rundev" that mounts your local "web" folder.
RUN ln -s /usr/share/nginx/node_modules /usr/share/nginx/web/node_modules
#ADD node_modules /usr/share/nginx/html/node_modules
# Append "daemon off;" to the beginning of the configuration
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
ADD /secrets/client/cert.pem /etc/nginx/ssl/nginx.cert
ADD /secrets/client/key.pem /etc/nginx/ssl/nginx.key
ADD vehicle_stats.json /usr/share/nginx/web/vehicle_stats.json
#RUN mkdir -p /etc/nginx/ssl/ \
# && openssl req \
# -x509 \
# -subj "/C=US/ST=Denial/L=Nowhere/O=Dis" \
# -nodes \
# -days 365 \
# -newkey rsa:2048 \
# -keyout /etc/nginx/ssl/nginx.key \
# -out /etc/nginx/ssl/nginx.cert
# Expose ports
EXPOSE 443
# Set the default command to execute
# when creating a new container
CMD service nginx start