Skip to content

Commit ba6f3d1

Browse files
updated
1 parent e256898 commit ba6f3d1

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

Diff for: chapter-15/.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cypress
2+
node_modules

Diff for: chapter-15/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Stage 1
2+
FROM node:15-alpine as build
3+
WORKDIR /app
4+
ENV PATH /app/node_modules/.bin:$PATH
5+
COPY package.json ./
6+
COPY package-lock.json ./
7+
RUN npm install
8+
COPY . ./
9+
RUN npm run build
10+
11+
# Stage 2
12+
FROM nginx:stable-alpine
13+
COPY --from=build /app/build /usr/share/nginx/html
14+
COPY nginx.conf /etc/nginx/conf.d/default.conf
15+
EXPOSE 80
16+
CMD ["nginx", "-g", "daemon off;"]

Diff for: chapter-15/nginx.conf

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
17+
}

0 commit comments

Comments
 (0)