Here is a ready to deploy ip geo location server, It works for both ip v4 and ip v6, However the underlying database is not that huge, It makes use of the OpenGeoFeed database found here,
Create docker-compose.yml
like that:
version: "3.3"
services:
geoip:
container_name: geoip
image: your_regisrty_ip:registry_port/geoip:latest
build:
context: .
dockerfile: ./Dockerfile
restart: always
ports:
- 8000:8000
Build and run:
docker compose --progress=plain build --no-cache --force-rm --pull geoip
docker compose push geoip
docker compose up -d --no-build --no-deps --force-recreate geoip
Open in browser: http://localhost:8000
Request:
curl -X POST http://localhost:8000/getIpInfo/140.82.114.3
Response:
{"ip":"140.82.114.3","country":"US"}