-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
146 lines (131 loc) · 4.63 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
138
139
140
141
142
143
144
145
146
version: '3.8'
x-api-config: &api-config
env_file: accessmap-incremental.env
build:
context: https://github.com/accessmap/accessmap-api.git#v0.1.3
x-router-config: &router-config
env_file: accessmap-incremental.env
build: ./dockerfiles/unweaver
services:
#
# primary services:
# `docker-compose up`.
#
caddy:
env_file: accessmap-incremental.env
image: abiosoft/caddy:0.11.5-no-stats
restart: unless-stopped
volumes:
- ./config/caddy/Caddyfile:/etc/Caddyfile
- caddy-persist:/root/.caddy
- ./build/tiles:/tiles:ro
- ./build/webapp:/webapp
- ./input/config.geojson:/regions/regions.geojson:ro
- ./output/transportation-tasks.geojson:/data/transportation.geojson
links:
- router
- api
api:
<<: *api-config
command: poetry run gunicorn --bind 0.0.0.0:5000 'wsgi:build_app(endpoint="/api/v1")'
stop_signal: SIGINT
restart: unless-stopped
dns:
- 8.8.8.8
- 8.8.4.4
router:
<<: *router-config
command: poetry run unweaver serve /data -h 0.0.0.0 -p 5656
restart: unless-stopped
stop_signal: SIGINT
volumes:
- ./build/router:/data:rw
#
# "migrate" steps - these run database migrations
# `docker-compose run migrate_api-db`
#
migrate_api_db:
<<: *api-config
command: sh -c "poetry run flask db upgrade && poetry run flask db migrate"
profiles:
- migrate
#
# "data" steps - run these using the "data" profile to create the input data
# for the web application. This should be run before the "build" or main
# stages
#
data_fetch:
env_file: accessmap-incremental.env
build: ./osm_opensidewalks
entrypoint: "osm_osw fetch /input/config.geojson"
environment:
- OSM_OSW_WORKDIR=/output
volumes:
- ./input:/input:ro
- ./output:/output:rw
profiles:
- data
data_osm_osw:
env_file: accessmap-incremental.env
build: ./osm_opensidewalks
entrypoint: "osm_osw runall /input/config.geojson"
environment:
- OSM_OSW_WORKDIR=/output
volumes:
- ./input:/input:ro
- ./output:/output:rw
profiles:
- data
data_incremental:
env_file: accessmap-incremental.env
build: ./incremental
entrypoint: bash -c "incremental fetch /input/tasks.json /input/tasks && incremental crossings /shared/transportation.geojson /shared/transportation-crossings_mapped.geojson /input/tasks/crossings/*.geojson && incremental sidewalks /shared/transportation-crossings_mapped.geojson /shared/transportation-tasks.geojson /input/tasks/sidewalks/*.geojson"
volumes:
- ./output:/shared:rw
- ./input/incremental:/input:rw
profiles:
- data
#
# "build" steps - run these using the "build" profile to create the assets
# for AccessMap before running the other services.
# `docker-compose run build_router && docker-compose run build_tiles && docker-compose run build_webapp`
#
build_router:
<<: *router-config
command: bash -c "cp -r /inputconfig/* /data && cp -r /inputdata/layers /data/ && poetry run unweaver build /data --changes-sign incline"
# Makes progress bar update in the terminal
tty: true
volumes:
- ./config/unweaver:/inputconfig:rw
- ./output/transportation-tasks.geojson:/inputdata/layers/transportation.geojson:ro
- ./build/router:/data:rw
profiles:
- build
build_tiles:
env_file: accessmap-incremental.env
build: ./dockerfiles/tippecanoe
entrypoint: "sh /build_tiles.sh /home/tippecanoe/input /home/tippecanoe/output"
volumes:
- ./config/tippecanoe/build_tiles.sh:/build_tiles.sh:ro
- ./config/tippecanoe/pedestrian-tilejson.json:/home/tippecanoe/pedestrian.json:ro
- ./config/tippecanoe/regions-tilejson.json:/home/tippecanoe/regions.json:ro
- ./config/tippecanoe/tasks-tilejson.json:/home/tippecanoe/tasks.json:ro
- ./output/transportation-tasks.geojson:/home/tippecanoe/input/transportation.geojson:ro
- ./output/transportation-crossings_mapped.geojson.crossingtasks.geojson:/home/tippecanoe/input/crossing_tasks.geojson:ro
- ./output/transportation-tasks.geojson.sidewalktasks.geojson:/home/tippecanoe/input/sidewalk_tasks.geojson:ro
- ./input/config.geojson:/home/tippecanoe/input/regions.geojson:ro
- ./build/tiles:/home/tippecanoe/output:rw
profiles:
- build
build_webapp:
env_file: accessmap-incremental.env
build:
context: https://github.com/accessmap/accessmap-webapp.git#7da92b009a24d818ef4ca8a1d925d78279bab94e
command: npm run build
volumes:
- ./build/webapp:/www/public
- ./input/config.geojson:/www/regions.json:ro
profiles:
- build
volumes:
caddy-persist: