config: expose GeoLite2 data via env vars

Adds GeoLite2 databases and configures nginx to expose the data via GEOIP2_ namespaced environment variables.
This commit is contained in:
Marcus Welz
2019-09-10 20:37:30 -04:00
parent 2e11991573
commit addfa1a5a5
4 changed files with 58 additions and 0 deletions

View File

@@ -242,6 +242,12 @@ ADD conf/nginx-site.conf /etc/nginx/sites-available/default.conf
ADD conf/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf
RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf
# Add GeoLite2 databases (https://dev.maxmind.com/geoip/geoip2/geolite2/)
RUN curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz -o /etc/nginx/GeoLite2-City.mmdb.gz \
&& curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz -o /etc/nginx/GeoLite2-Country.mmdb.gz \
&& gunzip /etc/nginx/GeoLite2-City.mmdb.gz \
&& gunzip /etc/nginx/GeoLite2-Country.mmdb.gz
# tweak php-fpm config
RUN echo "cgi.fix_pathinfo=0" > ${php_vars} &&\
echo "upload_max_filesize = 100M" >> ${php_vars} &&\