This is an unofficial docker image for Photon
Photon is an open-source geocoding solution built for OpenStreetMap (OSM) data, providing features such as search-as-you-type and reverse geocoding. This repository offers a Docker image for running Photon locally, enhancing data privacy and integration capabilities with services like Dawarich.
Running Photon locally enables:
- Data Privacy: Local geocoding operations ensure that location data is not sent to external servers.
- Performance Optimization: Reducing the need for external API calls minimizes latency and improves response times.
- Operational Control: Using Docker containers allows for straightforward management, updates, and scalability of the geocoding service.
- The Photon index file is fairly large (approximately 75-76GB compressed, 150-160GB uncompressed).
- Ensure you have sufficient disk space available before running the container.
- The initial download and extraction process may take a considerable amount of time.
- If you want to download only a single country, you may specify the country code using the "COUNTRY_CODE" variable in docker compose.
- You can find a list of available country codes here
services:
photon:
image: rtuszik/photon-docker:latest
environment:
- COUNTRY_CODE=zw
volumes:
- photon_data:/photon/photon_data
restart: unless-stopped
ports:
- "2322:2322"
volumes:
photon_data:
docker-compose up -d
-
Set the
PHOTON_VERSION
environment variable to the desired version:export PHOTON_VERSION=0.5.0
-
Use Docker Compose to build the image locally and start Photon:
docker-compose -f docker-compose.build.yml up --build
This will build and run Photon using the specified version.
-
The Photon API can be accessed at:
http://localhost:2322/api?q=Harare
Replace
Harare
with any other query as needed.
The Photon index is stored in a Docker volume (photon_data
) to persist the data across container restarts and removals. This also allows you to pre-populate the volume with an existing index if needed.
- On first run, the container will download and extract the latest Photon index, which may take several hours depending on your internet connection and system performance.
Contributions are welcome. Please submit pull requests or open issues for suggestions and improvements.
This project is licensed under the Apache License, Version 2.0.