Sign inSign up

valda/netgeoip

By valda

Updated almost 10 years ago

GeoIP service based on MaxMind mmdb database on windows 2016 nano server and .net core

Image
0

295

valda/netgeoip repository overview

Image serves simple RESTFull service for IP address geo location lockup. It uses internally database from MaxMind. to run image use:

docker run -p 5000:5000 valda/netgeoip

or for running in background

docker run -p 5000:5000 valda/netgeoip

To run container on Windows 2016 Datacenter server with containers and achieve automatic startup you can use this script (it creates c:\run.ps1 which is scheduled to run after system starts):

set-netfirewallprofile domain,public,private –Enabled false
docker pull valda/netgeoip

$text = "
set-netfirewallprofile domain,public,private –Enabled false
docker pull valda/netgeoip
`$dock = docker run -d -p 5000:5000 valda/netgeoip
`$ip = docker inspect -f `"{{ .NetworkSettings.Networks.nat.IPAddress }}`" `$dock
`$lip = (Get-NetIPConfiguration | where {`$_.IPv4DefaultGateway -ne `$null }).IPv4Address.IPAddress
netsh interface portproxy add v4tov4 listenport=5000 listenaddress=`$lip connectport=5000 connectaddress=`$ip
"
$text > c:\run.ps1

$trigger = New-JobTrigger -AtStartup -RandomDelay 00:00:30
Register-ScheduledJob -Trigger $trigger -FilePath C:\run.ps1 -Name RunDocker
For calling REST api service you can use URL in this format:

http://<IP ADDRESS>:5000/api/ip?addr=82.83.84.85

Tag summary

Content type

Image

Digest

Size

385 MB

Last updated

almost 10 years ago

docker pull valda/netgeoip