-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
137 lines (130 loc) · 4.3 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Create a network to use the Postgis-Server in another container.
# Networks are used to connect containers and allow them to communicate.
networks:
osm2vdv462_net:
name: ${DOCKER_NETWORK}
# Create docker volume which is a storage point located outside of containers.
# This is required to persistently store the database between docker restarts.
volumes:
postgis:
ppr:
pgadmin:
python:
services:
osm2vdv462_postgis:
image: postgis/postgis:16-master
container_name: osm2vdv462_postgis
restart: unless-stopped
networks:
- ${DOCKER_NETWORK}
ports:
- "${PGPORT}:5432"
volumes:
- "postgis:/var/lib/postgresql/data"
# copy the sql setup files to the container
# the sql files located in this folder will be executed once on the first start of the container
# see: https://hub.docker.com/_/postgres (Initialization scripts)
- "${PWD}/pipeline/setup/sql/:/docker-entrypoint-initdb.d/"
environment:
POSTGRES_DB: ${PGDATABASE}
POSTGRES_USER: ${PGUSER}
POSTGRES_PASSWORD: ${PGPASSWORD}
PG_PRIMARY_PORT: ${PGPORT}
hostname: osm2vdv462_postgis
healthcheck: # test if the database is ready to accept connections
test: ["CMD-SHELL", "pg_isready -U ${PGUSER} -d ${PGDATABASE}"]
interval: 5s
timeout: 1s
retries: 5
osm2vdv462_ppr_preprocess:
image: ghcr.io/motis-project/ppr:pr-71
volumes:
- "ppr:/data"
# a placeholder path must be set when "IMPORT_FILE_PATH" is empty, otherwise there will be an error decoding the compose project
# the current path is used as the fallback host bind mount location: ":-$PWD"
# see: "Shell Parameter Expansion"
- "${IMPORT_FILE_PATH:-$PWD}:/data/input/${IMPORT_FILE}"
command: "/ppr/ppr-preprocess --osm /data/input/${IMPORT_FILE} --graph /data/germany.ppr"
container_name: osm2vdv462_ppr_preprocess
profiles:
- ppr_preprocess
user: root
osm2vdv462_ppr_backend:
image: ghcr.io/motis-project/ppr:pr-71
ports:
- "9042:8000"
volumes:
- "ppr:/data"
- "${PWD}/pipeline/routing/config/config_ppr.ini:/data/config.ini"
networks:
- ${DOCKER_NETWORK}
restart: unless-stopped
command: "/ppr/ppr-backend -c /data/config.ini"
container_name: osm2vdv462_ppr_backend
profiles:
- ppr_backend
user: root
osm2vdv462_python:
build: ./pipeline/routing
image: osm2vdv462_python
container_name: osm2vdv462_python
environment:
host_postgis: osm2vdv462_postgis
port_postgis: ${PGPORT}
db_postgis: ${PGDATABASE}
user_postgis: ${PGUSER}
password_postgis: ${PGPASSWORD}
host_ppr: osm2vdv462_ppr_backend
stdin_open: true
tty: true
networks:
- ${DOCKER_NETWORK}
depends_on:
osm2vdv462_postgis:
condition: service_healthy # wait for the database to be ready before starting pgadmin
hostname: osm2vdv462_python
volumes:
- "python:/app"
- "${PWD}/pipeline/routing/ppr.py:/app/ppr.py"
- "${PWD}/pipeline/routing/config/profiles/:/app/profiles/"
osm2vdv462_pgadmin4:
image: dpage/pgadmin4
ports:
- "80:80"
container_name: osm2vdv462_pgadmin4
volumes:
- "${PWD}/pipeline/setup/pgadmin_servers.json:/pgadmin4/servers.json"
- "pgadmin:/var/lib/pgadmin"
environment:
PGADMIN_DEFAULT_EMAIL: ${PG_ADMIN_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PG_ADMIN_PASSWORD}
networks:
- ${DOCKER_NETWORK}
hostname: osm2vdv462_pgadmin4
depends_on:
osm2vdv462_postgis:
condition: service_healthy # wait for the database to be ready before starting pgadmin
profiles:
- pgadmin4
osm2vdv462_osm2pgsql:
image: rportugal/osm2pgsql
container_name: osm2vdv462_osm2pgsql
volumes:
- "${PWD}/pipeline/stop_places/lua:/scripts/osm2pgsql"
- "${IMPORT_FILE_PATH:-$PWD}:/input/${IMPORT_FILE}"
environment:
PGHOST: osm2vdv462_postgis
PGDATABASE: ${PGDATABASE}
PGUSER: ${PGUSER}
PGPASSWORD: ${PGPASSWORD}
IMPORT_FILE: ${IMPORT_FILE}
networks:
- ${DOCKER_NETWORK}
stdin_open: true
tty: true
hostname: osm2vdv462_osm2pgsql
depends_on:
osm2vdv462_postgis:
condition: service_healthy # wait for the database to be ready before starting osm2pgsql
profiles:
- osm2pgsql