-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 689 Bytes
/
Dockerfile
File metadata and controls
30 lines (23 loc) · 689 Bytes
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
### STAGE 1: Build ###
FROM node:8.12.0-alpine AS build
## PROJECT DIR ##
WORKDIR /opt/dmart/notifications
## ACCEPT Runtime argument and set REACT_APP_STAGE ENV [DEV, UAT, PROD]
ARG runtime
ENV REACT_APP_STAGE $runtime
## Install react scripts required to build react app
RUN npm install react-scripts -g --silent
## Copy package and install dependencies
COPY package.json .
RUN npm install
## Copy project fles
COPY . .
## Build
RUN npm run build
### STAGE 2: Production Environment ###
FROM nginx:1.17.5-alpine
RUN rm -rf /etc/nginx/conf.d
COPY conf /etc/nginx
COPY --from=build /opt/dmart/notifications/build /usr/share/nginx/html
EXPOSE 3080
CMD ["nginx", "-g", "daemon off;"]