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

feat: add docker-compose.prod.yml for deployment #87

Merged
merged 1 commit into from
Jun 14, 2024
Merged
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
60 changes: 60 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: "3"

services:
oba_bundler:
build: ./bundler
volumes:
- ./bundle:/bundle
environment:
- GTFS_URL

oba_database:
image: mysql:8.3
container_name: oba_database
environment:
MYSQL_ROOT_PASSWORD: Ins3cure!
MYSQL_DATABASE: oba_database
MYSQL_USER: oba_user
MYSQL_PASSWORD: oba_password
ports:
- "3306:3306"
volumes:
- type: volume
source: mysql-data
target: /var/lib/mysql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen to the mysql data between updates?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mysql data will not be affected, docker will still use mysql-data volume, it will be the same image with the same data, see https://docs.docker.com/storage/volumes/#use-a-volume-with-docker-compose

restart: always

oba_app:
image: opentransitsoftwarefoundation/onebusaway-api-webapp:${OBA_VERSION:-latest}
container_name: oba_app
depends_on:
- oba_database
environment:
- JDBC_URL=jdbc:mysql://oba_database:3306/oba_database
- JDBC_USER=oba_user
- JDBC_PASSWORD=oba_password
- TEST_API_KEY
- TZ
- VEHICLE_POSITIONS_URL
- TRIP_UPDATES_URL
- ALERTS_URL
- REFRESH_INTERVAL=30
- AGENCY_ID
- GOOGLE_MAPS_API_KEY

volumes:
# Share the host"s `bundle` directory
# with the filesystem of the OBA service.
- ./bundle:/bundle
ports:
# Access the webapp on your host machine at a path like
# http://localhost:8080/onebusaway-api-webapp/api/where/agency/${YOUR_AGENCY}.json?key=TEST
- "8080:8080"
# restart: always
labels:
caddy: "${DOMAIN}"
caddy.reverse_proxy: "{{upstreams 8080}}"

volumes:
mysql-data:
caddy-data: {}
Loading