feat: add nginx and update node version

This commit is contained in:
Sergey Krylov 2024-07-01 06:13:05 +03:00
parent 67319ef61d
commit 50c7f4f76c
4 changed files with 16 additions and 3 deletions

2
.nvmrc
View File

@ -1 +1 @@
20.14.0
20.15.0

9
nginx.conf Normal file
View File

@ -0,0 +1,9 @@
server {
listen 80;
server_name frontend;
location / {
# This would be the directory where your React app's static files are stored at
root /usr/share/nginx/html;
try_files $uri /index.html;
}
}

View File

@ -7,6 +7,7 @@
"start:dev": "ksv741-react-scripts start --env mode=development",
"build:prod": "ksv741-react-scripts build --env mode=production",
"analyze:prod": "ksv741-react-scripts build --env mode=production analyze=true",
"watch": "docker run --rm -v ./build:/usr/share/nginx/html -v ./nginx.conf:/etc/nginx/conf.d/default.conf --name react-nginx-app -p 8080:80 nginx:1.27.0",
"lint": "eslint src",
"test:start": "jest",
"test:coverage": "jest --coverage",
@ -14,7 +15,7 @@
"release": "standard-version"
},
"engines": {
"node": "=20.11.1"
"node": "20.15.0"
},
"private": true,
"repository": "git+https://gitlab.com/money-control2/web/frontend.git",

View File

@ -6,7 +6,10 @@
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="manifest" href="manifest.json" />
<% if (process.env.NODE_ENV === 'production') { %>
<link rel="manifest" href="manifest.json" />
<% } %>
</head>
<body>
<div id="root"></div>