-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
41 lines (36 loc) · 924 Bytes
/
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
version: '3'
services:
db:
image: postgres
container_name: postgres_app
environment:
POSTGRES_DB: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pg_data:/var/lib/postgresql/data/pgdata
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
app:
build: .
container_name: app_container
tty: true
command: bash -c "python manage.py migrate && python manage.py add_su && python manage.py loaddata data.json && python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "python manage.py showmigrations" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
pg_data: