build utils
This commit is contained in:
@ -1 +1,42 @@
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: backend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8000"
|
||||
env_file:
|
||||
- path: ./env/backend/prod.env
|
||||
required: true
|
||||
volumes:
|
||||
- ./backend/app:/code/app:z
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nginx:
|
||||
build:
|
||||
dockerfile: ./nginx/Dockerfile
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- ./static:/static
|
||||
depends_on:
|
||||
- backend
|
||||
ports:
|
||||
- "80:80"
|
||||
postgres:
|
||||
image: postgres:16.2-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./postgres_data:/var/lib/postgresql/data/
|
||||
env_file:
|
||||
- path: ./env/postgres.env
|
||||
required: true
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} --user $${POSTGRES_USER}"]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 5
|
||||
|
||||
3
env/backend/prod.env
vendored
3
env/backend/prod.env
vendored
@ -0,0 +1,3 @@
|
||||
POSTGRES_USER=user
|
||||
POSTGRES_PASSWORD=password
|
||||
POSTGRES_DB=db
|
||||
5
env/frontend/prod.env
vendored
5
env/frontend/prod.env
vendored
@ -0,0 +1,5 @@
|
||||
CI=true
|
||||
PORT=3000
|
||||
HOST=0.0.0.0
|
||||
WDS_SOCKET_PORT=0
|
||||
REACT_APP_DOMAIN=127.0.0.1
|
||||
@ -64,5 +64,8 @@
|
||||
},
|
||||
"Dashboard": {
|
||||
"ru": "Панель управления"
|
||||
},
|
||||
"Page not found": {
|
||||
"ru": "Страница не найдена"
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,8 @@ const NotFoundPage = () => {
|
||||
<div style={{ width: "100%", marginTop: "3rem" }}>
|
||||
<QuestionCircleOutlined style={{ fontSize: "5rem" }} />
|
||||
</div>
|
||||
<Title>{tr("Not found")}</Title>
|
||||
<Title>{tr("Page not found")}</Title>
|
||||
<Title level={3}>404</Title>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
11
nginx/Dockerfile
Normal file
11
nginx/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM node:21-alpine as build
|
||||
WORKDIR /app
|
||||
ENV PATH /app/node_modules/.bin:$PATH
|
||||
COPY ./frontend/app .
|
||||
RUN npm ci
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.25.4-alpine
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@ -1,6 +1,6 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name 192.168.1.121;
|
||||
server_name queueful.ollyhearn.ru;
|
||||
location / {
|
||||
proxy_hide_header 'Access-Control-Allow-Origin';
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
@ -25,7 +25,7 @@ server {
|
||||
proxy_hide_header 'Access-Control-Allow-Methods';
|
||||
add_header 'Access-Control-Allow-Methods' '*' always;
|
||||
|
||||
proxy_pass http://api:8000/api/;
|
||||
proxy_pass http://backend:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
Reference in New Issue
Block a user