1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:15 +02:00
dockerfiles/freegeoip
2020-01-09 17:22:20 +08:00
..
data update 2020-01-09 17:22:20 +08:00
docker-compose.yml add freegeoip 2018-11-28 14:05:02 +08:00
Dockerfile update 2020-01-09 17:22:20 +08:00
freegeoip.service update 2020-01-09 17:22:20 +08:00
README.md update freegeoip 2018-11-28 14:38:37 +08:00

freegeoip

docker-compose.yml

freegeoip:
  image: vimagick/freegeoip
  ports:
    - "8080:8080"
    - "8888:8888"
  restart: always

up and running

$ docker-compose up -d

$ curl -s http://localhost:8080/json/8.8.8.8 | jq .
{
  "ip": "8.8.8.8",
  "country_code": "US",
  "country_name": "United States",
  "region_code": "",
  "region_name": "",
  "city": "",
  "zip_code": "",
  "time_zone": "",
  "latitude": 37.751,
  "longitude": -97.822,
  "metro_code": 0
}

$ curl -s http://localhost:8888/metrics
freegeoip_client_connections{proto="http"} 0
freegeoip_client_country_code_total{country_code="unknown"} 7
freegeoip_client_ipproto_version_total{ip="4"} 7
freegeoip_db_events_total{event="loaded"} 1
go_gc_duration_seconds{quantile="0"} 5.9754e-05
go_gc_duration_seconds{quantile="0.25"} 7.0367e-05
go_gc_duration_seconds{quantile="0.5"} 9.6169e-05
go_gc_duration_seconds{quantile="0.75"} 0.000112867
go_gc_duration_seconds{quantile="1"} 0.000260533
go_gc_duration_seconds_sum 0.001055739