The simplest way to deploy a OneBusAway server to a compatible cloud provider (e.g. Render, Heroku) is by creating an immutable Docker image prebuilt with your transit agency's static GTFS data feed.
With a little hosting provider-specific automation, you should be able to automatically deploy the latest version of your image from the container registry to which you upload the image.
The Open Transit Software Foundation uses this approach with OBACloud, our OneBusAway as a Service offering, to build and deploy new containers in an easy, predictable, and horizontally scalable manner.
All of the files referenced below can be found in the immutable directory.
- Create a private repository on GitHub that will be the source for your images.
- Copy
Dockerfile.mbta,docker-compose.yaml,bin, andconfiginto your repository. - Run
mkdir -p .github/workflowsin your repository and then copydocker.yamlto.github/workflows/docker.yaml - Test your new Docker image by running it with
docker compose up oba_app - Assuming it builds successfully, access it at http://localhost:8080 and validate it using the
bin/validate.shscript at the root of this repo. - Once you have successfully validated your image, commit your changes to GitHub and create a new Release of your repository.
- The creation of the Release will kick off a new Action to build your Docker images. It will take 10-15 minutes to create the new images. Once it finishes, you'll be able to find them in your organization's Packages page.
To update your image—for instance to force an update to the static GTFS feed, simply increment the "REVISION" value. You can automate this using sed or manually change the value. Then, create a new Release via the GitHub UI, command line, or API.