-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (74 loc) · 2.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
78 lines (74 loc) · 2.1 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
services:
postgres:
build:
context: ./docker/postgres
dockerfile: Dockerfile
container_name: zonepilot-postgres
environment:
POSTGRES_USER: ${DB_USER:-zonepilot}
POSTGRES_PASSWORD: ${DB_PASSWORD:-zonepilot}
POSTGRES_DB: ZonePilot
ports:
- "5434:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./docker/init-db:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-zonepilot} -d ZonePilot"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
networks:
- zonepilot-net
# Road network importer — runs once, imports bangalore.osm.pbf into the
# blr_2po_4pgr table used by pgRouting. Exits 0 on success; Docker marks
# it as "exited" which is expected. Re-run with:
# docker compose run --rm road-network-importer
road-network-importer:
image: pgrouting/osm2pgrouting:latest
container_name: zonepilot-road-importer
depends_on:
postgres:
condition: service_healthy
volumes:
- ./bangalore.osm.pbf:/data/bangalore.osm.pbf:ro
command: >
osm2pgrouting
--file /data/bangalore.osm.pbf
--conf /usr/share/osm2pgrouting/mapconfig.xml
--dbname ZonePilot
--host postgres
--port 5432
--username ${DB_USER:-zonepilot}
--password ${DB_PASSWORD:-zonepilot}
--schema public
--prefix blr_
--clean
networks:
- zonepilot-net
profiles:
- road-network
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: zonepilot-backend
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/ZonePilot
SPRING_DATASOURCE_USERNAME: ${DB_USER:-zonepilot}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD:-zonepilot}
SPRING_PROFILES_ACTIVE: dev
GOOGLE_ROUTES_API_KEY: ${GOOGLE_ROUTES_API_KEY:-}
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
networks:
- zonepilot-net
volumes:
pgdata:
networks:
zonepilot-net:
driver: bridge