-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
38 lines (31 loc) · 1.09 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
###############################################################################
## Name: Dockerfile
## Date: 2018-09-23
## Developer: Chris Page
## Email: [email protected]
## Purpose: This Dockerfile contains the frontend application
################################################################################
## build stage
# Using official node runtime base apline image
FROM node:10.11-alpine as build-env
# Set the file maintainer (your name - the file's author)
MAINTAINER Chris Page <[email protected]>
# Set the application directory
RUN mkdir -p /app
WORKDIR /app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json /app/
# Install app dependencies
RUN npm install
# Bundle app source
COPY . .
RUN npm run build
### STAGE 2: Production Environment ###
FROM nginx:1.15-alpine
COPY config/nginx.conf /etc/nginx/nginx.conf
COPY config/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build-env /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]