Sign inSign up

moinologics/ip2location

By moinologics

•Updated about 3 years ago

ip to location finder using maxmind database (with auto database update functionality)

Image
0

880

moinologics/ip2location repository overview

⁠IP2Location Service (using maxmind database)

⁠How to Use

  1. pull docker image
docker pull moinologics/ip2location:latest
  1. run docker container
docker run --rm \
  -e MAXMIND_ACCOUNT_ID=your-maxmind-user-id \
  -e MAXMIND_LICENSE_KEY=your-maxmind-license-key \
  -e MAXMIND_EDITION_IDS=GeoLite2-City \
  -p 8080:8080 \
  moinologics/ip2location:latest
  1. get location for ipv4
curl --location 'http://localhost:8080/location/38.152.13.107
  1. get location for ipv6
curl --location 'http://localhost:8080/location/2001:4860:4860::8888'

⁠Docker Container Envirolment Variables

ENVDESCRIPTIONRequired
MAXMIND_ACCOUNT_IDyour maxmind account id
(can we found on license key page⁠)
YES
MAXMIND_LICENSE_KEYyour maxmind license key
(can we found/generate on license key page⁠)
YES
MAXMIND_EDITION_IDSspace seprated GEOIP EDITION IDs
for example GeoLite2-City
YES
ALLOWED_API_KEYAPI key which should we provided in API-KEY header for Authentication
if not provided, no authentication will be used
NO

⁠HTTP request Authentication

if you provided ALLOWED_API_KEY env in docker container with a non empty string, than you have to send this api key in header API-KEY with same value

example request

curl --location 'http://localhost:8080/location/38.152.13.107' --header 'API-KEY: yourapikey'

⁠Automatic database update

one cronjob is also scheduled for running every night at 12:00 (UTC)

⁠Github repo

https://github.com/moinologics/ip2location⁠

⁠Developer Contact

[email protected]⁠

Tag summary

Content type

Image

Digest

sha256:aff928b38…

Size

9.5 MB

Last updated

about 3 years ago

docker pull moinologics/ip2location