-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
35 lines (34 loc) · 985 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
version: "3.9"
services:
postgres:
image: postgres:14.5
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 5s
timeout: 5s
retries: 50
web:
restart: on-failure:5
build: .
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
# command: bash -c "yes | python manage.py makemigrations --merge && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
volumes:
- ./tmp/mysqld:/run/mysqld
- .:/code
ports:
- "8000:8000"
environment:
- POSTGRES_NAME=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
depends_on:
postgres:
condition: service_healthy