-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·54 lines (50 loc) · 1.23 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
version: '3.8'
services:
py_django:
container_name: py_django
build: ./
command: bash -c 'while !</dev/tcp/py_db/5432; do sleep 1; done; python manage.py migrate && python manage.py runserver 0.0.0.0:8000'
volumes:
- ./app:/app
ports:
- "127.0.0.1:8000:8000"
environment:
- DEBUG=${DEBUG}
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@py_db:5432/${POSTGRES_DB}
depends_on:
- py_db
env_file:
- ./.env
restart: always
py_db:
container_name: py_db
image: postgres:15-alpine
volumes:
- py_data:/var/lib/postgresql@15/data/
expose:
- 5432
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
env_file:
- ./.env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
restart: always
py_pgadmin:
container_name: py_pgadmin
image: dpage/pgadmin4
ports:
- "8088:80"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: postgres
depends_on:
- py_db
restart: always
volumes:
py_data: