-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
160 lines (160 loc) · 4.28 KB
/
docker-compose.yml
File metadata and controls
160 lines (160 loc) · 4.28 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
services:
db:
hostname: db
image: postgres:17.5
restart: on-failure
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=jacfarm
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "jacfarm", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
flag_queue:
hostname: flag_queue
build:
context: .
dockerfile: ./docker/Dockerfile.flag_queue
restart: on-failure
environment:
- RABBITMQ_DEFAULT_USER=rmuser
- RABBITMQ_DEFAULT_PASS=rmpassword
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{connection,error},{default,error}] disk_free_limit 2147483648
volumes:
- ./volumes/rabbitmq:/var/lib/rabbitmq
ports:
- 127.0.0.1:15672:15672
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
config_loader:
build:
context: ./workers/config_loader
dockerfile: ../../docker/Dockerfile.config_loader
restart: no
environment:
- PG_USERNAME=postgres
- PG_PASSWORD=postgres
- PG_DB_NAME=jacfarm
- PG_HOST=db
- PG_PORT=5432
- CONFIG_PATH=/app/config.yml
volumes:
- ./config.yml:/app/config.yml
depends_on:
db:
condition: service_healthy
exploit_runner:
build:
context: ./workers/exploit_runner
dockerfile: ../../docker/Dockerfile.exploit_runner
restart: on-failure
environment:
- PG_USERNAME=postgres
- PG_PASSWORD=postgres
- PG_DB_NAME=jacfarm
- PG_HOST=db
- PG_PORT=5432
- RABBITMQ_HOST=flag_queue
- RABBITMQ_PORT=5672
- RABBITMQ_USERNAME=rmuser
- RABBITMQ_PASSWORD=rmpassword
- EXPLOIT_DIR=/app/exploits
- ENV=prod
volumes:
- ./volumes/exploits:/app/exploits
depends_on:
db:
condition: service_healthy
flag_queue:
condition: service_healthy
config_loader:
condition: service_completed_successfully
flag_sender:
build:
context: ./workers/flag_sender
dockerfile: ../../docker/Dockerfile.flag_sender
restart: on-failure
environment:
- PG_USERNAME=postgres
- PG_PASSWORD=postgres
- PG_DB_NAME=jacfarm
- PG_HOST=db
- PG_PORT=5432
- RABBITMQ_HOST=flag_queue
- RABBITMQ_PORT=5672
- RABBITMQ_USERNAME=rmuser
- RABBITMQ_PASSWORD=rmpassword
- PLUGIN_DIR=/app/plugins
- ENV=prod
depends_on:
db:
condition: service_healthy
flag_queue:
condition: service_healthy
config_loader:
condition: service_completed_successfully
jacfarm_api:
hostname: jacfarm-api
build:
context: ./jacfarm-api
dockerfile: ../docker/Dockerfile.jacfarm-api
ports:
- 127.0.0.1:1337:1337
restart: on-failure
environment:
- PG_USERNAME=postgres
- PG_PASSWORD=postgres
- PG_DB_NAME=jacfarm
- PG_HOST=db
- PG_PORT=5432
- RABBITMQ_HOST=flag_queue
- RABBITMQ_PORT=5672
- RABBITMQ_USERNAME=rmuser
- RABBITMQ_PASSWORD=rmpassword
- RABBITMQ_MANAGEMENT_HOST=flag_queue
- RABBITMQ_MANAGEMENT_PORT=15672
- HTTP_HOST=0.0.0.0
- HTTP_PORT=1337
- HTTP_READ_TIMEOUT=10s
- HTTP_WRITE_TIMEOUT=10s
- HTTP_IDLE_TIMEOUT=60s
- HTTP_CORS_ALLOWED_ORIGINS=http://127.0.0.1:5173,http://localhost:5173
- ENV=prod
- JACFARM_API_KEY=${JACFARM_API_KEY}
- EXPLOIT_DIR=/app/exploits
volumes:
- ./volumes/exploits:/app/exploits
depends_on:
db:
condition: service_healthy
flag_queue:
condition: service_healthy
frontend:
container_name: jacfarm_frontend
build:
context: jacfarm-frontend
dockerfile: ../docker/Dockerfile.jacfarm-frontend
ports:
- 15050:80
restart: on-failure
depends_on:
jacfarm_api:
condition: service_started
environment:
- ADMIN_PASS=${ADMIN_PASS}
healthcheck:
test: ["CMD", "curl", "http://127.0.0.1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s