Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for real time GTFS feed #24

Merged
merged 6 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.development.template → .env.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# needed by the node.js web-app
GTFS_REALTIME_TOKEN=place your 511.org token here or leave blank to disable GTFS-RT
GTFS_REALTIME_ALERTS_URL=https://api.511.org/transit/servicealerts?agency=RG
GTFS_REALTIME_VEHICLE_POSITIONS_URL=https://api.511.org/transit/vehiclepositions?agency=RG
GTFS_REALTIME_TRIP_UPDATES_URL=https://api.511.org/transit/tripupdates?agency=RG
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
WEB_APP_AGENCY_NAMES_FILE_HOST_PATH=/ABSOLUTE/PATH/TO/volumes/agencies/names.json
WEB_APP_AGENCY_NAMES_FOLDER_CONTAINER_PATH=/mnt/agencies/names.json
CACHE_CONN_STRING=redis://default:@cache:6379

# needed for geoconfig-generator
GTFS_ZIP_CONTAINER_PATH=/usr/app/mnts/gtfs.zip
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.12.1
20.12.2
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.12-alpine
FROM node:20.12-alpine
WORKDIR /app
RUN apk --no-cache add curl dumb-init
COPY package.json /app
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM node:18.12-alpine
FROM node:20.12-alpine
WORKDIR /app
RUN apk --no-cache add curl dumb-init
COPY package.json /app
COPY package-lock.json /app
RUN npm install
COPY ./src /app/src
EXPOSE 3001
EXPOSE 9229
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD node --inspect=0.0.0.0:9229 /app/src/index.js
44 changes: 37 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ services:
memory: 512M
reservations:
memory: 256M
env_file:
- path: ./.env
required: true
environment:
FILE_SERVICE_NAME: bikehopper-fit-file-server-svc
PORT: "${WEB_APP_CONTAINER_PORT}"
Expand All @@ -29,7 +32,9 @@ services:
start_period: 5s
timeout: 2s
image: ghcr.io/bikehopper/bikehopper-web-app:v1.1.11
build: .
build:
context: .
dockerfile: ./Dockerfile.dev
labels:
- "app=bikehopper-web-app"
- "traefik.enable=true"
Expand All @@ -38,13 +43,33 @@ services:
volumes:
- "${WEB_APP_GEO_CONFIG_HOST_PATH}:${WEB_APP_GEO_CONFIG_FOLDER_CONTAINER_PATH}"
- "${WEB_APP_AGENCY_NAMES_FILE_HOST_PATH}:${WEB_APP_AGENCY_NAMES_FOLDER_CONTAINER_PATH}"
- "${WEB_APP_DATA_ACK_FILE_HOST_PATH}:${WEB_APP_DATA_ACK_FOLDER_CONTAINER_PATH}"
# - "${WEB_APP_DATA_ACK_FILE_HOST_PATH}:${WEB_APP_DATA_ACK_FOLDER_CONTAINER_PATH}"
ports:
- "${WEB_APP_CONTAINER_PORT}:${WEB_APP_CONTAINER_PORT}"
- 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

geoconfig-generator:
container_name: geoconfig-generator
deploy:
Expand All @@ -56,6 +81,9 @@ services:
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}"
Expand All @@ -64,7 +92,7 @@ services:
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.1
image: ghcr.io/bikehopper/gtfs-processor:v1.1.3
command: "node /app/src/generateLocalTransitBounds.js"
depends_on:
gtfs-downloader:
Expand All @@ -80,12 +108,14 @@ services:
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"

version: '3.8'
command: "s3 cp s3://${AWS_S3_GTFS_KEY} /aws"
Loading
Loading