From f84f7c47bf46b282e369cd1ec220173ff50846b7 Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 25 Apr 2023 18:28:24 +0800 Subject: [PATCH] update freegeoip --- freegeoip/Dockerfile | 10 +++++----- freegeoip/README.md | 13 +++---------- freegeoip/docker-compose.yml | 14 ++++++++------ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/freegeoip/Dockerfile b/freegeoip/Dockerfile index 99ef2e8..f8d253c 100644 --- a/freegeoip/Dockerfile +++ b/freegeoip/Dockerfile @@ -2,12 +2,12 @@ # Dockerfile for freegeoip # -FROM alpine +FROM alpine:3 MAINTAINER EasyPi Software Foundation -ENV FREEGEOIP_VERSION=3.4.1 -ENV FREEGEOIP_FILE=freegeoip-${FREEGEOIP_VERSION}-linux-amd64.tar.gz -ENV FREEGEOIP_URL=https://github.com/fiorix/freegeoip/releases/download/v${FREEGEOIP_VERSION}/${FREEGEOIP_FILE} +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} WORKDIR /opt/freegeoip @@ -21,4 +21,4 @@ COPY data/GeoLite2-City.mmdb.gz /opt/freegeoip/data/ EXPOSE 8080 8888 ENTRYPOINT ["./freegeoip"] -CMD ["-public", "public", "-http", ":8080", "-internal-server", ":8888", "-db", "data/GeoLite2-City.mmdb.gz"] +CMD ["-public", "public", "-http", ":8080", "-internal-server", ":8888", "-db", "data/GeoLite2-City.mmdb.gz", "-use-x-forwarded-for"] diff --git a/freegeoip/README.md b/freegeoip/README.md index 4bd1258..be7ba5a 100644 --- a/freegeoip/README.md +++ b/freegeoip/README.md @@ -1,16 +1,7 @@ freegeoip ========= -## docker-compose.yml - -```yaml -freegeoip: - image: vimagick/freegeoip - ports: - - "8080:8080" - - "8888:8888" - restart: always -``` +[freegeoip][1] provides a public HTTP API for software developers to search the geolocation of IP addresses. ## up and running @@ -44,3 +35,5 @@ go_gc_duration_seconds{quantile="0.75"} 0.000112867 go_gc_duration_seconds{quantile="1"} 0.000260533 go_gc_duration_seconds_sum 0.001055739 ``` + +[1]: https://freegeoip.io/ diff --git a/freegeoip/docker-compose.yml b/freegeoip/docker-compose.yml index 47eb825..23ea734 100644 --- a/freegeoip/docker-compose.yml +++ b/freegeoip/docker-compose.yml @@ -1,6 +1,8 @@ -freegeoip: - image: vimagick/freegeoip - ports: - - "8080:8080" - - "8888:8888" - restart: always +version: "3.8" +services: + freegeoip: + image: vimagick/freegeoip + ports: + - "8080:8080" + - "8888:8888" + restart: unless-stopped