-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (53 loc) · 1.24 KB
/
docker-compose.yml
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
volumes:
postgresql-data:
services:
database:
image: postgres:16
restart: always
expose:
- "5432"
ports:
- "5432:5432"
volumes:
- postgresql-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_DB: saudedrfdb
POSTGRES_PASSWORD: postgrespw
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 10
migrations:
build:
context: .
dockerfile: Dockerfile.dev
target: migrations
command: python manage.py migrate --noinput
environment:
DATABASE_URL: postgres://postgres:postgrespw@database:5432/saudedrfdb
volumes:
- ./src:/app/saude_drf
depends_on:
database:
condition: service_healthy
web:
container_name: saude_drf
build:
context: .
dockerfile: Dockerfile.dev
target: web
command: python manage.py runserver 0.0.0.0:3000
environment:
DATABASE_URL: postgres://postgres:postgrespw@database:5432/saudedrfdb
DEBUG: 1
volumes:
- ./src:/app/saude_drf
ports:
- "3000:3000"
depends_on:
database:
condition: service_healthy
migrations:
condition: service_completed_successfully