-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
102 lines (96 loc) · 2.39 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
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
100
101
102
version: "3.3"
services:
app:
image: oeffikator
build:
context: .
dockerfile: oeffikator/Dockerfile
ports:
- 8000:8000
environment:
OEFFI_DB_NAME: ${OEFFI_DB_NAME}
OEFFI_DB_CONTAINER_NAME: ${OEFFI_DB_CONTAINER_NAME}
OEFFI_BVG_API_CONTAINER_NAME: ${OEFFI_BVG_API_CONTAINER_NAME}
OEFFI_MAX_WEST: ${OEFFI_MAX_WEST}
OEFFI_MAX_EAST: ${OEFFI_MAX_EAST}
OEFFI_MAX_SOUTH: ${OEFFI_MAX_SOUTH}
OEFFI_MAX_NORTH: ${OEFFI_MAX_NORTH}
depends_on:
db:
condition: service_healthy
bvg-api:
condition: service_healthy
secrets:
- oeffi_db_user
- oeffi_db_pw
container_name: ${OEFFI_APP_CONTAINER_NAME}
healthcheck:
test:
[
"CMD-SHELL",
"echo $(( $(curl --write-out '%{http_code}\n' --silent --output /dev/null localhost:8000/alive) == 200 ? 0 : 1 ))"
]
interval: 5s
timeout: 5s
retries: 3
db:
image: postgis/postgis
ports:
- "5432:5432"
environment:
POSTGRES_USER_FILE: /run/secrets/oeffi_db_user
POSTGRES_PASSWORD_FILE: /run/secrets/oeffi_db_pw
POSTGRES_DB: ${OEFFI_DB_NAME}
secrets:
- oeffi_db_user
- oeffi_db_pw
volumes:
- ./scripts/:/docker-entrypoint-initdb.d/
- pgdata:/var/lib/postgresql/data:rw
container_name: ${OEFFI_DB_CONTAINER_NAME}
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U $(cat /run/secrets/oeffi_db_user) -d ${OEFFI_DB_NAME}"
]
interval: 5s
timeout: 5s
retries: 3
visualization:
image: visualization
build:
context: .
dockerfile: visualization/Dockerfile
ports:
- "80:80"
environment:
OEFFI_APP_CONTAINER_NAME: ${OEFFI_APP_CONTAINER_NAME}
OEFFI_MAX_WEST: ${OEFFI_MAX_WEST}
OEFFI_MAX_EAST: ${OEFFI_MAX_EAST}
OEFFI_MAX_SOUTH: ${OEFFI_MAX_SOUTH}
OEFFI_MAX_NORTH: ${OEFFI_MAX_NORTH}
depends_on:
app:
condition: service_healthy
bvg-api:
image: derhuerst/bvg-rest:6
ports:
- "3000:3000"
container_name: ${OEFFI_BVG_API_CONTAINER_NAME}
healthcheck:
test:
[
"CMD-SHELL",
"echo 0"
]
interval: 5s
timeout: 5s
retries: 3
secrets:
oeffi_db_pw:
file: oeffikator_db_pw.txt
oeffi_db_user:
file: oeffikator_db_user.txt
volumes:
pgdata: