-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 977 Bytes
/
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
# Create the container from the alpine linux image
FROM alpine:3.7
# Add nginx and nodejs
RUN apk add --update nginx nodejs
# Create the directories we will need
RUN mkdir -p /tmp/nginx/aura
RUN mkdir -p /var/log/nginx
RUN mkdir -p /var/www/html
# Copy the respective nginx configuration files
COPY nginx_config/nginx.conf /etc/nginx/nginx.conf
COPY nginx_config/default.conf /etc/nginx/conf.d/default.conf
# Set the directory we want to run the next commands for
WORKDIR /tmp/nginx/aura
# Copy our source code into the container
COPY . .
# Install the dependencies, can be commented out if you're running the same node version
RUN npm install
# run webpack and the vue-loader
RUN npm run build
# copy the built app to our served directory
RUN cp -r dist/* /var/www/html
# make all files belong to the nginx user
RUN chown nginx:nginx /var/www/html
# start nginx and keep the process from backgrounding and the container from quitting
CMD ["nginx", "-g", "daemon off;"]