-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (90 loc) · 2.96 KB
/
docker-compose.yml
File metadata and controls
97 lines (90 loc) · 2.96 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
services:
# ── App database ─────────────────────────────────────────────────────────────
app-db:
image: postgres:17-alpine
environment:
POSTGRES_DB: ${DB_NAME:-exam_platform}
POSTGRES_USER: ${DB_USERNAME:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is required}
volumes:
- app-db-data:/var/lib/postgresql/data
networks:
- app-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-postgres} -d ${DB_NAME:-exam_platform}"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
# ── Application (NestJS + built Vue) ─────────────────────────────────────────
app:
build: .
ports:
- "${PORT:-3000}:3000"
environment:
NODE_ENV: production
PORT: 3000
DB_HOST: app-db
DB_PORT: 5432
DB_USERNAME: ${DB_USERNAME:-postgres}
DB_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is required}
DB_NAME: ${DB_NAME:-exam_platform}
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-21600}
JUDGE0_URL: ${JUDGE0_URL:-http://judge0-server:2358}
ADMIN_SETUP_KEY: ${ADMIN_SETUP_KEY:?ADMIN_SETUP_KEY is required}
CORS_ORIGIN: ${CORS_ORIGIN:-}
depends_on:
app-db:
condition: service_healthy
networks:
- app-network
- judge0-network
restart: unless-stopped
# ── Judge0 ────────────────────────────────────────────────────────────────────
judge0-server:
image: judge0/judge0:1.13.1
privileged: true
env_file: judge0/judge0.conf
depends_on:
- judge0-db
- judge0-redis
networks:
- judge0-network
restart: unless-stopped
judge0-worker:
image: judge0/judge0:1.13.1
command: ["./scripts/workers"]
privileged: true
env_file: judge0/judge0.conf
depends_on:
- judge0-db
- judge0-redis
networks:
- judge0-network
restart: unless-stopped
# postgres:16 - Judge0 1.13.1 is not tested against postgres 17
judge0-db:
image: postgres:16-alpine
environment:
POSTGRES_DB: judge0
POSTGRES_USER: judge0
# Must match POSTGRES_PASSWORD in judge0/judge0.conf
POSTGRES_PASSWORD: judge0
volumes:
- judge0-db-data:/var/lib/postgresql/data
networks:
- judge0-network
restart: unless-stopped
judge0-redis:
image: redis:7.2.4-alpine
networks:
- judge0-network
restart: unless-stopped
networks:
app-network:
judge0-network:
volumes:
app-db-data:
judge0-db-data: