Deploy request module frontend

This commit is contained in:
2026-08-15 23:12:07 +03:00
parent 0e7d5ddbad
commit 1ccd170ae7
3 changed files with 55 additions and 5 deletions
+15 -5
View File
@@ -1,10 +1,10 @@
version: '3.8' version: "3.8"
services: services:
app: app:
build: . build: .
ports: expose:
- "8000:8000" - "8000"
environment: environment:
- DATABASE_URL=postgresql://user:password@db:5432/service_request - DATABASE_URL=postgresql://user:password@db:5432/service_request
- REDIS_URL=redis://redis:6379/0 - REDIS_URL=redis://redis:6379/0
@@ -20,7 +20,7 @@ services:
- TWILIO_FROM_NUMBER=+15017250604 - TWILIO_FROM_NUMBER=+15017250604
- APP_ENV=development - APP_ENV=development
- APP_DEBUG=True - APP_DEBUG=True
- APP_CORS_ORIGINS=http://localhost:3000,http://localhost:5173 - APP_CORS_ORIGINS=http://192.168.1.36
- MANAGEENGINE_CONNECTION_STRING= - MANAGEENGINE_CONNECTION_STRING=
depends_on: depends_on:
- db - db
@@ -31,6 +31,16 @@ services:
- /app/.venv - /app/.venv
command: uvicorn request_app.main:app --host 0.0.0.0 --port 8000 command: uvicorn request_app.main:app --host 0.0.0.0 --port 8000
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
- app
restart: unless-stopped
db: db:
image: postgres:15 image: postgres:15
environment: environment:
@@ -63,4 +73,4 @@ services:
volumes: volumes:
postgres_data: postgres_data:
redis_data: redis_data:
rabbitmq_data: rabbitmq_data:
@@ -0,0 +1,19 @@
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
@@ -0,0 +1,21 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://app:8000/api/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
try_files $uri $uri/ /index.html;
}
}