Skip to content

Commit 999e431

Browse files
committed
Production deployment files
1 parent 04878a3 commit 999e431

File tree

8 files changed

+72
-566
lines changed

8 files changed

+72
-566
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
dist
3+
node_modules
4+
build
5+
Dockerfile
6+
.dockerignore
7+
.gitignore
8+
README.md

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:14.18-alpine AS build
2+
3+
WORKDIR /app
4+
COPY package.json package-lock.json ./
5+
RUN npm install
6+
7+
COPY . ./
8+
RUN npm run build
9+
10+
FROM nginx:stable-alpine
11+
COPY --from=build /app/build /usr/share/nginx/html
12+
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
13+
EXPOSE 80
14+
CMD sed -i -e 's/$PORT/'"$PORT"'/g' /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'

nginx.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
server {
2+
listen $PORT;
3+
location / {
4+
root /usr/share/nginx/html;
5+
index index.html index.htm;
6+
try_files $uri $uri/ /index.html =404;
7+
}
8+
}

orginalIndex.html

Lines changed: 0 additions & 212 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"jest-webgl-canvas-mock": "^0.2.3",
104104
"less": "^4.1.1",
105105
"less-loader": "^7.3.0",
106+
"react-test-renderer": "^17.0.2",
106107
"typescript": "^4.3.5"
107108
},
108109
"jest": {

0 commit comments

Comments
 (0)