-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
39 lines (37 loc) · 963 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
39 lines (37 loc) · 963 Bytes
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
services:
db:
image: mysql:8.0
restart: always
environment:
MYSQL_DATABASE: meetflow_db
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: rootpassword
volumes:
- mysql_data:/var/lib/mysql
ports:
- "3306:3306"
# O healthcheck verifica se o MySQL está pronto antes de liberar o container web
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
web:
build: .
# Adicionamos um pequeno delay (sleep) por segurança e rodamos o migrate automaticamente
command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/app
ports:
- "8000:8000"
environment:
- DB_NAME=meetflow_db
- DB_USER=user
- DB_PASSWORD=password
- DB_HOST=db
- DB_PORT=3306
depends_on:
db:
condition: service_healthy
volumes:
mysql_data: