docker-compose.yml
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
services:
postgres:
image: postgres:16-alpine
container_name: rps-postgres
command: ["postgres", "-p", "15432"]
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-robot_production_system}
POSTGRES_USER: ${POSTGRES_USER:-robot}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-robot}
ports:
- "${POSTGRES_PORT:-15432}:15432"
volumes:
- rps-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -p 15432 -U ${POSTGRES_USER:-robot} -d ${POSTGRES_DB:-robot_production_system}"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: rps-backend
restart: unless-stopped
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
ASPNETCORE_URLS: ${ASPNETCORE_URLS:-http://+:8000}
ConnectionStrings__DefaultConnection: Host=postgres;Port=15432;Database=${POSTGRES_DB:-robot_production_system};Username=${POSTGRES_USER:-robot};Password=${POSTGRES_PASSWORD:-robot}
FileStorage__UploadsRoot: /app/uploads
ports:
- "${BACKEND_PORT:-8000}:8000"
volumes:
- rps-uploads-data:/app/uploads
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 10
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
NUXT_PUBLIC_API_BASE: ${NUXT_PUBLIC_API_BASE:-/api}
container_name: rps-frontend
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
ports:
- "${FRONTEND_PORT:-8080}:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
volumes:
rps-postgres-data:
rps-uploads-data: