Skip to content

Commit

Permalink
cleanup docker compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
Andykmcc committed May 1, 2024
1 parent a694a32 commit 7f1ff8f
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 69 deletions.
12 changes: 12 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# needed by the node.js web-app
GTFS_REALTIME_TOKEN=place your 511.org token here or leave blank to disable GTFS-RT

### These endpoints can have strict rate limiting. In that case, during local development
### swap the real endpoints for the commented out "static" endpoints. Then add add the
### appropirate file to ./volumes/static via curl. This way your local machine gets the GTFS
### from a local server instead of the rate limits production endpoint.
###
### e.g.
### curl -o ./volumes/static/vehiclepositions.protobuf 'https://api.511.org/transit/vehiclepositions?agency=RG'
GTFS_REALTIME_ALERTS_URL=https://api.511.org/transit/servicealerts?agency=RG
# GTFS_REALTIME_ALERTS_URL=http://static/servicealerts.protobuf
GTFS_REALTIME_VEHICLE_POSITIONS_URL=https://api.511.org/transit/vehiclepositions?agency=RG
# GTFS_REALTIME_VEHICLE_POSITIONS_URL=http://static/vehiclepositions.protobuf
GTFS_REALTIME_TRIP_UPDATES_URL=https://api.511.org/transit/tripupdates?agency=RG
# GTFS_REALTIME_TRIP_UPDATES_URL=http://static/tripupdates.protobuf

WEB_APP_CONTAINER_PORT=8080
WEB_APP_GEO_CONFIG_HOST_PATH=./volumes/geoconfigs # path to location on host machine
WEB_APP_GEO_CONFIG_FOLDER_CONTAINER_PATH=/mnt/geoconfig
Expand Down
133 changes: 64 additions & 69 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,75 +48,70 @@ services:
ports:
- 9229:9229
- ${WEB_APP_CONTAINER_PORT}:${WEB_APP_CONTAINER_PORT}
# depends_on:
# cache:
# condition: service_started
# geoconfig-generator:
# condition: service_completed_successfully

# cache:
# container_name: cache
# image: eqalpha/keydb
# ports:
# - 6379:6379
# volumes:
# - ./keydb.conf:/etc/keydb/keydb.conf
# deploy:
# restart_policy:
# condition: none
# replicas: 1
# resources:
# limits:
# memory: 256M
# reservations:
# memory: 128M
cache:
container_name: cache
image: eqalpha/keydb
ports:
- 6379:6379
volumes:
- ./keydb.conf:/etc/keydb/keydb.conf
deploy:
restart_policy:
condition: none
replicas: 1
resources:
limits:
memory: 256M
reservations:
memory: 128M

# geoconfig-generator:
# container_name: geoconfig-generator
# deploy:
# restart_policy:
# condition: none
# replicas: 1
# resources:
# limits:
# memory: 256M
# reservations:
# memory: 128M
# env_file:
# - path: ./.env
# required: true
# environment:
# FILTERED_AGENCY_IDS: "${FILTERED_AGENCY_IDS}"
# MANUALLY_FILTERED_ROUTE_IDS: "${MANUALLY_FILTERED_ROUTE_IDS}"
# GTFS_ZIP_PATH: "${GTFS_ZIP_CONTAINER_PATH}"
# OUTPUT_DIR_PATH: "/usr/app/mnts/output"
# volumes:
# - "${GTFS_ZIP_HOST_PATH}:${GTFS_ZIP_CONTAINER_PATH}"
# - "${WEB_APP_GEO_CONFIG_HOST_PATH}:/usr/app/mnts/output"
# image: ghcr.io/bikehopper/gtfs-processor:v1.1.3
# command: "node /app/src/generateLocalTransitBounds.js"
# depends_on:
# gtfs-downloader:
# condition: service_completed_successfully
geoconfig-generator:
container_name: geoconfig-generator
deploy:
restart_policy:
condition: none
replicas: 1
resources:
limits:
memory: 256M
reservations:
memory: 128M
env_file:
- path: ./.env
required: true
environment:
FILTERED_AGENCY_IDS: "${FILTERED_AGENCY_IDS}"
MANUALLY_FILTERED_ROUTE_IDS: "${MANUALLY_FILTERED_ROUTE_IDS}"
GTFS_ZIP_PATH: "${GTFS_ZIP_CONTAINER_PATH}"
OUTPUT_DIR_PATH: "/usr/app/mnts/output"
volumes:
- "${GTFS_ZIP_HOST_PATH}:${GTFS_ZIP_CONTAINER_PATH}"
- "${WEB_APP_GEO_CONFIG_HOST_PATH}:/usr/app/mnts/output"
image: ghcr.io/bikehopper/gtfs-processor:v1.1.3
command: "node /app/src/generateLocalTransitBounds.js"
depends_on:
gtfs-downloader:
condition: service_completed_successfully

# gtfs-downloader:
# image: amazon/aws-cli
# container_name: gtfs-downloader
# deploy:
# restart_policy:
# condition: none
# replicas: 1
# resources:
# reservations:
# memory: 128M
# env_file:
# - path: ./.env
# required: true
# environment:
# AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}"
# AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}"
# AWS_ENDPOINT_URL: "${AWS_ENDPOINT_URL}"
# AWS_S3_GTFS_KEY: "${AWS_S3_GTFS_KEY}"
# volumes:
# - "${DOWNLOADER_OUTPUT_HOST_PATH}:/aws"
# command: "s3 cp s3://${AWS_S3_GTFS_KEY} /aws"
gtfs-downloader:
image: amazon/aws-cli
container_name: gtfs-downloader
deploy:
restart_policy:
condition: none
replicas: 1
resources:
reservations:
memory: 128M
env_file:
- path: ./.env
required: true
environment:
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}"
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}"
AWS_ENDPOINT_URL: "${AWS_ENDPOINT_URL}"
AWS_S3_GTFS_KEY: "${AWS_S3_GTFS_KEY}"
volumes:
- "${DOWNLOADER_OUTPUT_HOST_PATH}:/aws"
command: "s3 cp s3://${AWS_S3_GTFS_KEY} /aws"

0 comments on commit 7f1ff8f

Please sign in to comment.