-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.testing.yml
More file actions
177 lines (167 loc) · 4.51 KB
/
Copy pathdocker-compose.testing.yml
File metadata and controls
177 lines (167 loc) · 4.51 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
x-common-env: &common-env
DATABASE_URL: postgres://olympus:olympus_dev@postgres:5432/olympus
REDIS_URL: redis://redis:6379
ENVIRONMENT: ${ENVIRONMENT:-production}
STORAGE_BASE_PATH: /mnt/data
services:
# ==========================================================================
# Infrastructure Services
# ==========================================================================
postgres:
image: postgres:16-alpine
container_name: olympus-postgres
env_file:
- .env
environment:
POSTGRES_USER: ${POSTGRES_USER:-olympus}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-olympus_dev}
POSTGRES_DB: ${POSTGRES_DB:-olympus}
# Port exposed only on localhost to prevent external connections
ports:
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U olympus"]
interval: 5s
timeout: 5s
retries: 5
networks:
- olympus-network
redis:
image: redis:7-alpine
container_name: olympus-redis
env_file:
- .env
command: redis-server --appendonly yes
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- olympus-network
# ==========================================================================
# Application Services
# ==========================================================================
vanguard:
build:
context: .
target: vanguard
container_name: olympus-vanguard
env_file:
- .env
environment:
<<: *common-env
JWT_SECRET: ${JWT_SECRET:-super_secret_jwt_key_change_in_production}
HOST: 0.0.0.0
PORT: 8080
ports:
- "${API_PORT:-8080}:8080"
volumes:
- olympus_data:/mnt/data
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
networks:
- olympus-network
sisyphus:
build:
context: .
target: sisyphus
container_name: olympus-sisyphus
env_file:
- .env
environment:
<<: *common-env
WORKER_ID: ${SISYPHUS_WORKER_ID:-sisyphus_1}
CONSUMER_GROUP: sisyphus_group
COMPILE_STREAM: compile_queue
NETWORK_ENABLED: ${NETWORK_ENABLED:-false}
COMPILATION_TIMEOUT_SECS: ${COMPILATION_TIMEOUT_SECS:-30}
DOCKER_API_VERSION: ${DOCKER_API_VERSION:-1.44}
DOCKER_VOLUME_NAME: ${DOCKER_VOLUME_NAME}
volumes:
- olympus_data:/mnt/data
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
vanguard:
condition: service_healthy
redis:
condition: service_healthy
networks:
- olympus-network
minos:
build:
context: .
target: minos
container_name: olympus-minos
env_file:
- .env
environment:
<<: *common-env
WORKER_ID: ${MINOS_WORKER_ID:-minos_1}
CONSUMER_GROUP: minos_group
STREAM_NAME: run_queue
METRICS_PORT: ${MINOS_METRICS_PORT:-9091}
DEFAULT_TIME_LIMIT_MS: ${DEFAULT_TIME_LIMIT_MS:-2000}
DEFAULT_MEMORY_LIMIT_KB: ${DEFAULT_MEMORY_LIMIT_KB:-262144}
# SYS_ADMIN is required for unshare(CLONE_NEWNET) and cgroup writes.
# privileged gives full cgroup write access for the sandbox.
cap_add:
- SYS_ADMIN
- NET_ADMIN
privileged: true
security_opt:
- apparmor:unconfined
ports:
- "${MINOS_METRICS_PORT:-9091}:9091"
volumes:
- olympus_data:/mnt/data
depends_on:
vanguard:
condition: service_healthy
redis:
condition: service_healthy
networks:
- olympus-network
horus:
build:
context: .
target: horus
container_name: olympus-horus
env_file:
- .env
environment:
<<: *common-env
TESTCASE_STALE_HOURS: ${TESTCASE_STALE_HOURS:-6}
TEMP_ORPHAN_HOURS: ${TEMP_ORPHAN_HOURS:-1}
SUBMISSION_RETENTION_DAYS: ${SUBMISSION_RETENTION_DAYS:-0}
volumes:
- olympus_data:/mnt/data
depends_on:
vanguard:
condition: service_healthy
redis:
condition: service_healthy
networks:
- olympus-network
networks:
olympus-network:
driver: bridge
volumes:
postgres_data:
redis_data:
olympus_data: