Skip to content

Commit a5a337f

Browse files
fully dockerized graph build
1 parent d38bcd3 commit a5a337f

File tree

1 file changed

+42
-5
lines changed

1 file changed

+42
-5
lines changed

otp-docker/otp-graph-build-compose.yml

+42-5
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,56 @@ services:
1010
# - type: bind
1111
# source: ~/.aws
1212
# target: /root/.aws
13-
otp-graph-build:
13+
mark-status-json-as-complete:
14+
image: alpine
15+
command: /bin/sh -c "apk add jq && touch /etc/caddy/static/status-new.json && jq '.serverStarted = \"true\"' /etc/caddy/static/status.json > /etc/caddy/static/status-new.json && rm /etc/caddy/static/status.json && mv /etc/caddy/static/status-new.json /etc/caddy/static/status.json"
16+
depends_on:
17+
upload-bundle:
18+
condition: service_healthy
19+
volumes:
20+
- type: bind
21+
source: ./caddy
22+
target: /etc/caddy/
23+
add-status-json-nonce:
24+
image: alpine
25+
command: "/bin/sh -e ./add-nonce.sh"
1426
depends_on:
1527
download-bundle:
1628
condition: service_completed_successfully
17-
image: alpine:latest
18-
command: /bin/sh -c "mkdir -p /var/otp/graphs/ && mkdir -p /opt/otp/ && apk add --no-cache aws-cli openjdk21 nodejs git yarn && yarn global add https://github.com/ibi-group/otp-runner.git && otp-runner /var/opentripplanner/otp-runner-graph-build-manifest.json"
29+
volumes:
30+
- type: bind
31+
source: ./otp
32+
target: /var/opentripplanner/
33+
- type: bind
34+
source: ./caddy
35+
target: /etc/caddy/
36+
- type: bind
37+
source: ./add-nonce.sh
38+
target: /add-nonce.sh
39+
otp-build:
40+
depends_on:
41+
add-status-json-nonce:
42+
condition: service_completed_successfully
43+
# TO do it dynamically: https://stackoverflow.com/a/50201232
44+
image: opentripplanner/opentripplanner:latest
45+
ports:
46+
- "8080:8080"
47+
command: "--build --save"
48+
restart: no
1949
volumes:
2050
- type: bind
2151
source: ./otp
2252
target: /var/opentripplanner
53+
upload-bundle:
54+
depends_on:
55+
otp-build:
56+
condition: service_completed_successfully
57+
image: amazon/aws-cli
58+
command: "s3 cp /var/opentripplanner/graph.obj ${S3_URI}/graph.obj"
59+
volumes:
2360
- type: bind
24-
source: ./caddy/static
25-
target: /usr/share/nginx/client/
61+
source: ./otp
62+
target: /var/opentripplanner
2663
caddy:
2764
image: caddy:latest
2865
restart: unless-stopped

0 commit comments

Comments
 (0)