-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (60 loc) · 1.53 KB
/
Copy pathdocker-compose.yml
File metadata and controls
62 lines (60 loc) · 1.53 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
services:
postgres:
image: postgres:18.1
env_file:
- .env
restart: ${DOCKER_RESTART_POLICY:-unless-stopped}
stop_grace_period: "3s"
shm_size: 512MB
volumes:
- pg_data:/var/lib/postgresql
- ./db/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
- ./db/postgresql.conf:/etc/postgresql/postgresql.conf
command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports:
- ${POSTGRES_PORT:-5432}:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- backend
webservice:
environment:
- DB_NAME
- DB_USER
- DB_PASSWORD
- ALLOW_ORIGINS
- ALLOW_ORIGIN_REGEX
- POSTGRES_PORT=5432
- POSTGRES_HOST=postgres
- WEB_CONCURRENCY
- PYTHON_MAX_THREADS
- API_KEY
image: ghcr.io/swiss-seismological-service/hydws:1.3.2
# build: .
depends_on:
postgres:
condition: service_healthy
restart: ${DOCKER_RESTART_POLICY:-unless-stopped}
stop_grace_period: "3s"
tty: true
ports:
- ${DOCKER_WEB_PORT:-8000}:8000
healthcheck:
test:
[
"CMD-SHELL",
'python -c "import urllib.request; urllib.request.urlopen(''http://localhost:$${DOCKER_WEB_PORT:-8000}/hydws/docs'', timeout=5)"',
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- backend
volumes:
pg_data: {}
networks:
backend: {}