Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit c4eb2b0

Browse files
authored
Add an example for baking in initial data
1 parent 4b789e4 commit c4eb2b0

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,20 @@ $ curl http://localhost:8080/api/whereabouts/not.an.ip.address
6666
GET requests to the root path `/` return the status code 200, but only after the
6767
initial database load has been done. This can be used for service readiness
6868
checks.
69+
70+
## Baking the Database into an Image
71+
72+
The Docker image does not contain a copy of the MaxMind GeoLite2 City
73+
database, which is always loaded from MaxMind's servers when Whereabouts
74+
starts. For situations where this is not feasible (e.g. environments without
75+
external network connectivity) you can build a custom image with that uses
76+
baked-in data for the initial load.
77+
78+
Create a Dockerfile with `hownetworks/whereabouts` as the base image:
79+
80+
```dockerfile
81+
# Instead of :latest use an explicit version such as :v0.3.4 in production
82+
FROM hownetworks/whereabouts:latest
83+
ADD --chown=app:app https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip /data/
84+
CMD /whereabouts -host 0.0.0.0 -init-url file:///data/GeoLite2-City-CSV.zip
85+
```

0 commit comments

Comments
 (0)