-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (93 loc) · 2.25 KB
/
docker-compose.yml
File metadata and controls
99 lines (93 loc) · 2.25 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version: "3.9"
services:
frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile
# command: python -m main
command: bash -c "
gunicorn frontend.main:app -b "0.0.0.0:8051" --reload
"
# environment:
# DASH_DEBUG: true
# DASH_HOT_RELOAD: true
ports:
- "8051:8051"
volumes:
- ./frontend:/frontend
depends_on:
api:
condition: service_healthy
api:
build:
context: ./api
dockerfile: ./Dockerfile
command: bash -c "
while !</dev/tcp/db/5432; do sleep 1; done;
alembic upgrade head;
uvicorn api.main:app
--host 0.0.0.0
--reload
"
ports:
- "8000:8000"
volumes:
- ./api:/api
depends_on:
- db
env_file:
- ./api/.env
healthcheck:
test: curl --fail http://localhost:8000/docs || exit 1
interval: 5s
# retries: 5
# start_period: 20s
# timeout: 10s
db:
image: postgres:11
volumes:
- postgis-data:/var/lib/postgresql
env_file:
- ./api/.env
environment:
# If you need to create multiple database you can add coma separated databases eg gis,data
- ALLOW_IP_RANGE=0.0.0.0/0
# Add extensions you need to be enabled by default in the DB. Default are the five specified below
# - POSTGRES_MULTIPLE_EXTENSIONS=postgis,hstore,postgis_topology,postgis_raster,pgrouting
# - TZ=America/Denver
# - PGTZ=America/Denver
ports:
- "5432:5432"
restart: on-failure
healthcheck:
test: "exit 0"
pgbackups:
image: prodrigestivill/postgres-backup-local
restart: always
user: postgres:postgres # Optional: see below
volumes:
- /var/opt/pgbackups:/backups
links:
- db
depends_on:
- db
env_file:
- ./api/.env
environment:
- POSTGRES_EXTRA_OPTS=-Z6 --schema=public --blobs
- SCHEDULE=@daily
- BACKUP_KEEP_DAYS=7
- BACKUP_KEEP_WEEKS=4
- BACKUP_KEEP_MONTHS=6
- HEALTHCHECK_PORT=8080
# pgadmin:
# container_name: pgadmin4_container
# image: dpage/pgadmin4
# restart: always
# environment:
# PGADMIN_DEFAULT_EMAIL: admin@admin.com
# PGADMIN_DEFAULT_PASSWORD: root
# ports:
# - "5050:80"
volumes:
postgis-data: