photon-docker/README.md

52 lines
1.7 KiB
Markdown
Raw Normal View History

2023-03-20 22:32:55 +01:00
Have your own geocoder up and running within the hour, you will require about 60GB of disk space and has no further dependencies. If you select a specific country, you can reduce the necessary disk space.
2017-07-19 14:09:19 +02:00
2023-03-20 22:32:55 +01:00
Feel free to fork and improve.
2017-07-19 12:54:37 +02:00
2023-03-20 22:32:55 +01:00
See this [blog post](https://tonsnoei.nl/en/post/2023/03/20/set-up-your-own-geocoder-api/) for mor info
2023-03-20 22:25:56 +01:00
2017-07-19 12:54:37 +02:00
# Run
2023-03-20 22:32:55 +01:00
The image itself is pretty small, the first time the container is executed, a 60GB searchindex will be downloaded. The [blog post](https://tonsnoei.nl/en/post/2023/03/20/set-up-your-own-geocoder-api/) explains how to use only a specific country or region.
2023-03-20 22:25:56 +01:00
2017-07-19 12:54:37 +02:00
The data volume is exposed as `/photon/photon_data` and can be mounted, this way you'll only have to download the data once.
## With `docker run`
2017-07-19 14:09:19 +02:00
```bash
2023-03-20 22:25:56 +01:00
docker run -p 2322:2322 -it tonsnoei/photon-geocoder:latest
2017-07-19 12:54:37 +02:00
```
2017-07-19 14:09:19 +02:00
## Search
```
2023-03-20 22:25:56 +01:00
http://localhost:2322/api?q=amsterdam
2017-07-19 14:09:19 +02:00
```
2023-03-20 22:32:55 +01:00
*For more details on the API check the Photon [github repository](https://github.com/komoot/photon).*
2017-07-19 14:09:19 +02:00
## Build from git
2023-03-20 22:32:55 +01:00
https://github.com/tonsnoei/photon-docker
2017-07-19 12:54:37 +02:00
### With docker-compose
2017-07-19 14:09:19 +02:00
```bash
docker-compose build #optional
2017-07-19 12:54:37 +02:00
docker-compose up
```
*Note: if you abort the download, you have to remove the volume `photon_data` before restarting the container*
## FAQ
- How do I pass arguments to the `photon.jar` ?
*The entrypoint accepts arguments for the `photon.jar`, you can invoke it by using `docker exec`*
- Do I need to have nominatim ?
*The container downloads the latest prebuilt search index, there is no immediate need to have nominatim installed.*
2023-03-20 22:32:55 +01:00
- What is Photon ?
2017-07-19 12:54:37 +02:00
2023-03-20 22:32:55 +01:00
*Photon is a geocoder, check out [their website](https://photon.komoot.de/) and their [github repository](https://github.com/komoot/photon)*