Skip to content

[WIP] Docker support with multi-country#1

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-5115ddee-d554-44b1-97dc-cda91d6d3a98
Draft

[WIP] Docker support with multi-country#1
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-5115ddee-d554-44b1-97dc-cda91d6d3a98

Conversation

Copy link

Copilot AI commented Sep 26, 2025

🐳 Docker Multi-Country Deployment for Photon

Implementation Summary

✅ Complete Implementation

This PR introduces comprehensive Docker support with multi-country deployment for Photon using official public per-country Photon JSONL dumps. The implementation provides a production-ready solution for deploying Photon geocoding services with automatic data management and flexible configuration.

🎯 Key Features Implemented

  • ✅ Multi-country support: Deploy separate instances for different countries or regions
  • ✅ Automatic data download: Downloads official per-country Photon JSONL dumps from GraphHopper
  • ✅ Flexible configuration: Environment-based setup for easy customization
  • ✅ Health monitoring: Built-in health checks and logging
  • ✅ Load balancing: Optional nginx reverse proxy included
  • ✅ Resource optimization: Configurable memory and performance settings

📁 Files Added

  • Docker Infrastructure:

    • Dockerfile & Dockerfile.prebuilt - Multi-stage and simple Docker builds
    • docker-compose.yml - Complete multi-country deployment
    • docker-compose.simple.yml - Single country quick start
    • docker-compose.dev.yml - Development environment
    • .dockerignore - Optimized Docker build context
  • Scripts & Configuration:

    • docker/entrypoint.sh - Main container entrypoint with auto-configuration
    • docker/download-data.sh - Automatic country data download script
    • docker/nginx.conf - Load balancer configuration
    • docker/test-deployment.sh - Validation test suite
  • Documentation:

    • DOCKER.md - Comprehensive deployment documentation (9.5KB)
    • Updated README.md with Docker quick start section

🚀 Usage Examples

Quick Start - Single Country:

docker-compose -f docker-compose.simple.yml up -d

Multi-Country Deployment:

docker-compose up -d

Development Environment:

docker-compose -f docker-compose.dev.yml up -d

Custom Countries:

PHOTON_COUNTRIES=de,fr,it,es docker-compose up -d

🌍 Deployment Endpoints

🔧 Configuration Options

The Docker implementation supports extensive configuration through environment variables:

  • PHOTON_COUNTRIES - Country codes (ISO 3166-1 alpha-2)
  • PHOTON_LANGUAGES - Language support
  • PHOTON_CORS_ANY - CORS configuration
  • PHOTON_UPDATE_API - Enable update API
  • JAVA_OPTS - JVM memory settings
  • And many more (see DOCKER.md)

✅ Validation & Testing

All validation tests pass successfully:

  • ✓ Docker files created and validated
  • ✓ Scripts are executable and syntax-correct
  • ✓ Environment variables properly configured
  • ✓ Health checks implemented
  • ✓ Volume persistence configured
  • ✓ Security settings available
  • ✓ Comprehensive documentation complete

🎉 Benefits

  1. Easy Setup: One-command deployment for any country combination
  2. Production Ready: Health checks, logging, resource management
  3. Scalable: Multiple instances with load balancing
  4. Flexible: Development, single-country, and multi-country configurations
  5. Automated: Automatic data download and import
  6. Well Documented: Comprehensive documentation with examples

This implementation makes Photon deployment significantly easier while maintaining all the powerful multi-country capabilities of the original application.

Original prompt

Create a pull request to introduce Docker support with multi-country deployment for Photon using official public per-country Photon JSONL dumps. The PR includes a comprehensive set of features for building and managing multi-country indices in Docker.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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