Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
156 lines (143 loc) · 3.52 KB
/
Copy pathdocker-compose.yml
File metadata and controls
156 lines (143 loc) · 3.52 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
x-logging:
&default-logging
logging:
driver: json-file
options:
max-size: 100M
services:
# --- SERVIÇOS DO JUDGE0 ---
judge0_server:
image: mrkushalsm/judge0:cgv2
platform: linux/amd64
container_name: judge0_server
depends_on:
- postgres
- judge0_redis
volumes:
- ./judge0.conf:/judge0.conf:ro
ports:
- "2358:2358"
privileged: true
<<: *default-logging
restart: always
judge0_workers:
image: mrkushalsm/judge0:cgv2
platform: linux/amd64
command: ["./scripts/workers"]
container_name: judge0_workers
depends_on:
- postgres
- judge0_redis
volumes:
- ./judge0.conf:/judge0.conf:ro
privileged: true
<<: *default-logging
restart: always
judge0_redis:
image: redis:7.2.4
container_name: judge0_redis
command: [
"bash", "-c",
'docker-entrypoint.sh --appendonly no --requirepass "$$REDIS_PASSWORD"'
]
env_file: judge0.conf
<<: *default-logging
restart: always
# --- REDIS DO LARAVEL ---
laravel_redis:
image: redis:7.2.4
container_name: laravel_redis
command: ["redis-server", "--appendonly", "no"]
<<: *default-logging
restart: always
queue_worker:
build:
context: ./back
dockerfile: src/docker/php/Dockerfile
container_name: laravel_queue
working_dir: /var/www/html
command: php artisan queue:work redis --queue=default --sleep=3 --tries=3
depends_on:
- backend_app
- laravel_redis
restart: unless-stopped
volumes:
- ./back/src/:/var/www/html:z
- /var/www/html/vendor
# --- SERVIÇOS DO BANCO DE DADOS DO BACKEND E JUDGE0 ---
postgres:
image: postgres:16.2
container_name: postgres
env_file: judge0.conf
environment:
- POSTGRES_DB_BACKEND=ifcodes
volumes:
- postgres_data:/var/lib/postgresql/data/
- ./init-backend-db.sh:/docker-entrypoint-initdb.d/init-backend-db.sh
<<: *default-logging
restart: always
ports:
- "5432:5432"
# --- SERVIÇOS DO BACKEND (LARAVEL) ---
backend_app:
build:
context: ./back
dockerfile: src/docker/php/Dockerfile
container_name: laravel_app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ./back/src/:/var/www/html:z
- /var/www/html/vendor
ports:
- "${BACKEND_PORT:-8000}:8000"
command: "php artisan serve --host=0.0.0.0 --port=8000"
depends_on:
- postgres
- judge0_server
- laravel_redis
# --- SERVIÇOS DO FRONTEND (REACT) ---
frontend_app:
build:
context: ./front
dockerfile: Dockerfile
container_name: react_app
restart: unless-stopped
volumes:
- ./front:/app
- /app/node_modules
ports:
- "5173:5173"
depends_on:
- backend_app
# --- SERVIÇO DO WS SERVER (WebSocket genérico) ---
ws_server:
build: ./ws-server
container_name: ws_server
restart: unless-stopped
ports:
- "3002:3001"
volumes:
- /proc:/host/proc:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- LARAVEL_API_URL=http://laravel_app:8000
- PORT=3001
- REDIS_HOST=laravel_redis
- JUDGE0_API_URL=http://judge0_server:2358
depends_on:
- backend_app
- laravel_redis
# --- SERVIÇO DE EMAIL (MAILPIT) ---
mailpit:
image: axllent/mailpit
container_name: mailpit
restart: unless-stopped
ports:
- "8025:8025"
- "1025:1025"
networks:
default:
driver: bridge
volumes:
postgres_data: