From 155c5d478402f61a184c8169311d8f9c45416a27 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Mon, 10 Jun 2024 10:29:07 +0200 Subject: [PATCH] Add MMDB download to Dockerfile (#11) --- Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 142808f..baf50fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,18 @@ COPY . ./ RUN go get ./... RUN go build -v -o /livestream ./... +# Fetch the GeoLite2-City database that will be used for IP geolocation within Django. +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + "ca-certificates" \ + "curl" \ + "brotli" \ + && \ + rm -rf /var/lib/apt/lists/* && \ + mkdir share && \ + ( curl -s -L "https://mmdbcdn.posthog.net/" --http1.1 | brotli --decompress --output=/mmdb.db ) && \ + chmod -R 755 /mmdb.db + FROM ubuntu -COPY --from=builder /livestream /livestream +COPY --from=builder /livestream /mmdb.db / CMD ["/livestream"]