This commit is contained in:
2023-05-26 23:45:36 +03:00
parent 5e377c8213
commit 2f1f7d072c
5 changed files with 51 additions and 32 deletions

37
prod.yml Normal file
View File

@ -0,0 +1,37 @@
services:
api:
build:
context: api
ports:
- "5000"
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=postgres
- POSTGRES_DB=flask
- PYTHONBUFFERED=0
react:
build:
context: react
dockerfile: prod.Dockerfile
ports:
- "3000"
environment:
- REACT_APP_DOMAIN=ovz1.ollyhearn.gmzem.vps.myjino.ru
nginx:
image: nginx:1.23.4
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./static:/static
depends_on:
- api
ports:
- "80:80"
postgres:
image: postgres:15.1
restart: always
volumes:
- ./postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: db

View File

@ -7,14 +7,7 @@ ENV WDS_SOCKET_PORT=0
WORKDIR /app
COPY /app /app
# COPY package.json /app/package.json
# COPY package-lock.json /app/package-lock.json
# Same as npm install
RUN npm ci
# COPY . /app
#
RUN printenv
CMD [ "npm", "start" ]

View File

@ -8057,19 +8057,6 @@
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
@ -22881,12 +22868,6 @@
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"optional": true
},
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",

View File

@ -27,12 +27,6 @@
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",

14
react/prod.Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM node:20-alpine
ENV PORT=3000
ENV HOST=0.0.0.0
ENV WDS_SOCKET_PORT=0
WORKDIR /app
COPY /app /app
RUN npm ci
RUN npm run build
CMD [ "npm", "start" ]