Skip to content

Commit 79d48c7

Browse files
committed
nginx
1 parent 606391e commit 79d48c7

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:12-alpine as build
2+
3+
WORKDIR /app
4+
5+
COPY . /app
6+
7+
RUN npm install --silent
8+
RUN npm install [email protected] -g --silent
9+
RUN npm run build
10+
11+
FROM nginx:1.18-alpine
12+
13+
COPY --from=build /app/build /usr/share/nginx/html
14+
RUN rm /etc/nginx/conf.d/default.conf
15+
COPY nginx/nginx.conf /etc/nginx/nginx.conf
16+
17+
EXPOSE 80
18+
CMD [ "nginx", "-g", "daemon off;" ]

nginx/nginx.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
server {
2+
3+
listen 80;
4+
5+
location / {
6+
root /usr/share/nginx/html;
7+
index index.html index.htm;
8+
try_files $uri $uri/ /index.html;
9+
}
10+
11+
error_page 500 502 503 504 /50x.html;
12+
13+
location = /50x.html {
14+
root /usr/share/nginx/html;
15+
}
16+
}

0 commit comments

Comments
 (0)