1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-23 01:39:27 +02:00
dockerfiles/freegeoip/Dockerfile
2023-04-25 18:39:49 +08:00

26 lines
780 B
Docker

#
# Dockerfile for freegeoip
#
FROM alpine:3
MAINTAINER EasyPi Software Foundation
ARG FREEGEOIP_VERSION=3.4.1
ARG FREEGEOIP_FILE=freegeoip-${FREEGEOIP_VERSION}-linux-amd64.tar.gz
ARG FREEGEOIP_URL=https://github.com/fiorix/freegeoip/releases/download/v${FREEGEOIP_VERSION}/${FREEGEOIP_FILE}
ARG MMDB_URL=https://cdn.jsdelivr.net/npm/geolite2-city@1.0.0/GeoLite2-City.mmdb.gz
WORKDIR /opt/freegeoip
RUN set -xe \
&& apk add --no-cache curl tar wget \
&& curl -sSL ${FREEGEOIP_URL} | tar xz --strip 1 \
&& mkdir -p data \
&& wget -P data ${MMDB_URL} \
&& apk del curl tar wget
EXPOSE 8080 8888
ENTRYPOINT ["./freegeoip"]
CMD ["-public", "public", "-http", ":8080", "-internal-server", ":8888", "-db", "data/GeoLite2-City.mmdb.gz", "-use-x-forwarded-for"]