Skip to content

Conversation

Copy link

Copilot AI commented Nov 7, 2025

Summary

Provides Docker containerization for OpenTripPlanner 2.5.0 running on Eclipse Temurin Java 21 JRE with exposed API on port 8080.

Issue

Addresses the need to run OTP as a containerized service accessible to external applications.

Implementation:

  • Dockerfile: Eclipse Temurin 21-jre base, downloads OTP 2.5.0, entrypoint script for runtime JAVA_OPTS configuration
  • docker-compose.yml: Service definition with volume mounting for GTFS/OSM data at ./data
  • Configuration: Default 4GB heap via JAVA_OPTS environment variable, configurable at runtime
  • Documentation: Setup instructions, API usage examples, data preparation guide

Technical approach:

  • Entrypoint script enables JVM memory tuning without image rebuild
  • Volume mount at /var/otp/graphs for transit data persistence
  • Default command: --load /var/otp/graphs --serve for graph building and API serving

Unit tests

No unit tests required - infrastructure configuration only. Manual verification:

  • Image builds successfully (470MB)
  • Java 21 LTS runtime confirmed
  • OTP 2.5.0 JAR functional
  • JAVA_OPTS environment variable applies at runtime
  • Docker Compose configuration validated

Documentation

  • README with quickstart, configuration, API usage, troubleshooting
  • data/README.md explaining GTFS and OSM file requirements
  • .env.example showing supported configuration options
  • Inline comments in Dockerfile explaining SSL handling for CI environments

Changelog

Include in changelog - adds Docker deployment capability for OTP.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.opentripplanner.org
    • Triggering command: curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Please create a Docker container with an instance of OpenTripPlanner (OTP). The purpose is to expose OTP's API for requests from different services.

As a Java program, OTP must be run within a Java virtual machine (JVM), which is provided as part of the Java runtime (JRE) or Java development kit (JDK). We recommend running on Java 21 rather than a later version, as it is a long-term support release.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add Docker container for OpenTripPlanner API Add Docker container with OpenTripPlanner on Java 21 LTS Nov 7, 2025
Copilot AI requested a review from fabianabarca November 7, 2025 13:05
Copilot finished work on behalf of fabianabarca November 7, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants