This repository was archived by the owner on Dec 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
186 lines (178 loc) · 4.43 KB
/
Copy pathdocker-compose.yml
File metadata and controls
186 lines (178 loc) · 4.43 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
178
179
180
181
182
183
184
185
186
services:
# MongoDB Replica Set Configurator (dev)
# Simple helper that runs once to initiate rs0 after mongodb is healthy
mongodb-configurator:
image: mongo:8.2.1
container_name: killcode-mongodb-configurator-dev
restart: "no"
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./scripts/init-replica-set.sh:/init-replica-set.sh:ro
command: ["/init-replica-set.sh"]
networks:
- killcode-network
# MongoDB Database
mongodb:
image: mongo:8.2.1
container_name: killcode-mongodb
restart: unless-stopped
command: ["--replSet", "rs0", "--bind_ip_all"]
ports:
- "${MONGODB_PORT}:27017"
volumes:
- mongodb_data:/data/db
- ./scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
networks:
- killcode-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
# Redis for Progress Tracking
redis:
image: redis:7-alpine
container_name: killcode-redis
restart: unless-stopped
ports:
- "${REDIS_PORT}:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- killcode-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Rust Backend Server
server:
build:
context: ./server
dockerfile: Dockerfile.dev
container_name: killcode-server
restart: unless-stopped
working_dir: /app
ports:
- "${SERVER_PORT_EXTERNAL}:8080"
env_file:
- .env
depends_on:
mongodb:
condition: service_healthy
mongodb-configurator:
condition: service_completed_successfully
weaver:
condition: service_healthy
mailer:
condition: service_healthy
networks:
- killcode-network
volumes:
- ./server:/app
- ./killer/builds:/app/overload_bins:ro
- ./server/geoip/data:/server/geoip/data:ro
- cargo_cache:/usr/local/cargo/registry
- target_cache:/app/target
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 120s
# Binary Weaving Service
weaver:
platform: linux/amd64
build:
context: ./weaver
dockerfile: Dockerfile.dev
additional_contexts:
osxcross: ./osxcross/target
llvm-mingw: ./llvm-mingw/llvm-mingw-ucrt
container_name: killcode-weaver
restart: unless-stopped
working_dir: /app
ports:
- "${WEAVER_PORT_EXTERNAL}:8080"
env_file:
- .env
depends_on:
redis:
condition: service_healthy
networks:
- killcode-network
volumes:
- ./weaver:/app
- bin_utils_cargo_cache:/usr/local/cargo/registry
- bin_utils_target_cache:/app/target
- weaver_temp:/tmp/weaver # Persistent temp directory for merged binaries
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 120s
# Mail Queue Service (internal only)
mailer:
build:
context: ./mailer
dockerfile: Dockerfile.dev
container_name: killcode-mailer
restart: unless-stopped
working_dir: /app
env_file:
- .env
depends_on:
redis:
condition: service_healthy
networks:
- killcode-network
volumes:
- ./mailer:/app
- mailer_cargo_cache:/usr/local/cargo/registry
- mailer_target_cache:/app/target
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 120s
# Next.js UI
ui:
build:
context: ./ui
dockerfile: Dockerfile.dev
container_name: killcode-ui
restart: unless-stopped
working_dir: /app
ports:
- "${UI_PORT}:5173"
env_file:
- .env
depends_on:
server:
condition: service_healthy
networks:
- killcode-network
volumes:
- ./ui:/app
- ./ui/node_modules:/app/node_modules
- /app/.next
networks:
killcode-network:
driver: bridge
volumes:
mongodb_data:
redis_data:
cargo_cache:
target_cache:
bin_utils_cargo_cache:
bin_utils_target_cache:
node_modules_cache:
ui_node_modules:
weaver_temp:
mailer_cargo_cache:
mailer_target_cache: