This repository contains a Dockerfile and a shell script for setting up an IP2Location MongoDB database. The script downloads the IP2Location database, decompresses it, sets up a MongoDB instance, and imports the data into a collection.
Before running the project, make sure you have the following:
- Docker installed on your system.
Follow the steps below to run the IP2Location MongoDB project:
-
Pull the Docker image from the GitHub Container Registry:
docker pull ghcr.io/casantosmu/docker-ip2location-mongodb:main
-
Build the Docker image locally:
docker build -t ip2location-mongodb .
-
Run the Docker container:
docker run -d --name ip2location-mongodb \ -e TOKEN=${TOKEN} \ -e MONGODB_PASSWORD=${MONGODB_PASSWORD} \ --network ip2location-mongodb \ ip2location-mongodb
Make sure to replace
${TOKEN}
and${MONGODB_PASSWORD}
with the appropriate values. -
Wait for the setup to complete. Once the setup is done, you can use the IP2Location database in your MongoDB instance.
- IP2Location - Provider of IP geolocation data.