-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
98 lines (92 loc) · 1.96 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
98 lines (92 loc) · 1.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
98
services:
# MySQL 데이터베이스
mysql:
image: mysql:8.0
restart: always
env_file:
- .env.production
volumes:
- mysql_data:/var/lib/mysql
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
# Redis 캐시
redis:
image: redis:7-alpine
restart: always
volumes:
- redis_data:/data
networks:
- app-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
# 백엔드 API (NestJS)
api:
build:
context: .
dockerfile: apps/api/Dockerfile
target: production
restart: always
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env.production
environment:
- NODE_ENV=production
ports:
- "3000:3000"
networks:
- app-network
# 채점 서버 (NestJS)
judge:
build:
context: .
dockerfile: apps/judge/Dockerfile
target: production
restart: always
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env.production
environment:
- NODE_ENV=production
- JUDGE_VOLUME=/judge-data
- JUDGE_HOST_PATH=/srv/judge-data
- JUDGE_PROBLEMS_PATH=/judge-data
- JUDGE_SUBMISSIONS_PATH=/judge-data/submissions
ports:
- "4000:4000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /srv/judge-data:/judge-data
networks:
- app-network
# 채점 러너 이미지 빌드
judge-runner:
build:
context: apps/judge/runner
dockerfile: Dockerfile
image: judge-javascript
restart: "no"
command: ["sh", "-c", "exit 0"]
networks:
- app-network
volumes:
mysql_data:
redis_data:
networks:
app-network:
driver: bridge