-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
48 lines (42 loc) · 1.08 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
version: '3.12'
x-environment: &environment
POSTGRES_DB: demo
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: db
GOOGLE_MAP_API_KEY: ${GOOGLE_MAP_API_KEY}
services:
web:
build: .
container_name: web
environment:
<<: *environment
command: bash -c "python /code/manage.py migrate --noinput && python /code/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
restart: true
db:
platform: linux/amd64
image: postgis/postgis
container_name: db
environment:
<<: *environment
volumes:
- ./docker/db/custom_postgresql.conf:/etc/postgresql.conf
- ./docker/db/custom_pg_hba.conf:/var/lib/postgresql/data/pg_hba.conf
- postgres_data:/var/lib/postgresql/data/
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
volumes:
postgres_data: