Express app utilising Maxmind GeoLite2 database. The app updates the database file at 00:00 hrs on every Sunday.
$ npm install
$ node index.js
Send a query param of ?ip=A.B.C.D
at the end of the hosted URL
http://localhost:3000/?ip=A.B.C.D
{
"ip": "A.B.C.D",
"continent": "Asia",
"country_code": "IN",
"country_name": "India",
"time_zone": "Asia/Kolkata",
"latitude": 17.3753,
"longitude": 78.4744,
"accuracy_radius": 10,
"city": "Hyderabad",
"region_name": "Telangana"
}
You bet! You can use the image by executing (parameters of -p 3000:3000
will enable you to access the API from the URL http://localhost:3000/?ip=A.B.C.D).
Read more at official Docker Repository
$ docker container run -d --name geoip-server -p 3000:3000 mib200/geoiplite2-maxmind
- Downloads the latest DB file automatically from Maxmind website.
- Auto updates the database file every week.
- Returns an absolute clean JSON response depending on how many fields are found in Maxmind DB response.
- Based on offical Maxmind package https://www.npmjs.com/package/maxmind
- GeoLite2 Free Downloadable Databases http://dev.maxmind.com/geoip/geoip2/geolite2/
MIT