Skip to content

Commit 93a85e2

Browse files
authored
added Dockerfile
1 parent 7991f23 commit 93a85e2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### STAGE 1: Build ###
2+
FROM node:12.7-alpine AS build
3+
WORKDIR /usr/src/app
4+
COPY package.json package-lock.json ./
5+
RUN npm install
6+
COPY . .
7+
RUN npm run build
8+
9+
### STAGE 2: Run ###
10+
FROM nginx:1.17.1-alpine
11+
COPY nginx.conf /etc/nginx/nginx.conf
12+
COPY --from=build /usr/src/app/dist /usr/share/nginx/html

nginx.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
events{}
2+
3+
http {
4+
5+
include /etc/nginx/mime.types;
6+
7+
server {
8+
listen 80;
9+
server_name localhost;
10+
root /usr/share/nginx/html;
11+
index index.html;
12+
13+
location / {
14+
try_files $uri $uri/ /index.html;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)