From f434cc542a76c5323a4d2c03448f4181431147f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 18 Sep 2020 07:59:12 +0200 Subject: [PATCH 1/4] Remove commented lines --- Dockerfile | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4345d83..57aaa02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,16 +16,6 @@ RUN true && \ # Results in /app/we-lang -# FROM ubuntu:18.04 -# RUN apt-get update && \ -# apt-get install -y curl \ -# git \ -# python \ -# python-pip \ -# python-dev \ -# autoconf \ -# libtool \ -# gawk FROM alpine:3 WORKDIR /app @@ -67,13 +57,6 @@ COPY --from=builder /app/we-lang /app/bin/we-lang COPY ./bin /app/bin COPY ./lib /app/lib COPY ./share /app/share - -# These files should be mounted by the user at runtime: -# /root/.wegorc -# /root/.ip2location.key (optional) -# /app/airports.dat -# /app/GeoLite2-City.mmdb - COPY share/docker/supervisord.conf /etc/supervisor/supervisord.conf ENV WTTR_MYDIR="/app" From 63ef3d02a9c0be9822cf661d462addd9c5322ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 18 Sep 2020 07:59:24 +0200 Subject: [PATCH 2/4] Remove useless true --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 57aaa02..63eaf52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,7 @@ COPY ./share/we-lang/we-lang.go /app RUN apk add --no-cache git -RUN true && \ - go get -u github.com/mattn/go-colorable && \ +RUN go get -u github.com/mattn/go-colorable && \ go get -u github.com/klauspost/lctime && \ go get -u github.com/mattn/go-runewidth && \ CGO_ENABLED=0 go build /app/we-lang.go From 792466ed0da8a0becd827a7b54193e29af60f84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 18 Sep 2020 08:02:44 +0200 Subject: [PATCH 3/4] Use apk --virtual instead of listing build time packages twice --- Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 63eaf52..d981c25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,16 @@ COPY ./requirements.txt /app ENV LLVM_CONFIG=/usr/bin/llvm9-config -RUN apk add --no-cache \ +RUN apk add --no-cache --virtual .build \ + autoconf \ + automake \ + g++ \ + gcc \ + jpeg-dev \ + llvm9-dev\ + make \ + zlib-dev \ + && apk add --no-cache \ python3 \ py3-pip \ py3-scipy \ @@ -31,17 +40,9 @@ RUN apk add --no-cache \ py3-gevent \ zlib \ jpeg \ - gcc \ - g++ \ llvm9 \ - make \ - autoconf \ - automake \ libtool \ supervisor \ - zlib-dev \ - jpeg-dev \ - llvm9-dev \ py3-numpy-dev \ python3-dev && \ mkdir -p /app/cache && \ @@ -50,7 +51,7 @@ RUN apk add --no-cache \ chmod -R o+rw /var/log/supervisor && \ chmod -R o+rw /var/run && \ pip install -r requirements.txt && \ - apk del --no-cache -r gcc g++ make autoconf automake libtool zlib-dev jpeg-dev llvm9-dev + apk del --no-cache -r .build COPY --from=builder /app/we-lang /app/bin/we-lang COPY ./bin /app/bin From 399c4d25ef1674782ad4ab4c53efe2baef6ebe7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 23 Sep 2020 07:45:09 +0200 Subject: [PATCH 4/4] Document files that should be mounted in Docker --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index fbfc2e1..5990f04 100644 --- a/README.md +++ b/README.md @@ -525,6 +525,19 @@ $ echo 'YOUR_IP2LOCATION_KEY' > ~/.ip2location.key If you don't have this file, the service will be silently skipped (it is not a big problem, because the MaxMind database is pretty good). +### Installation with Docker + +* Install Docker +* Build Docker Image +* These files should be mounted by the user at runtime: + +``` +/root/.wegorc +/root/.ip2location.key (optional) +/app/airports.dat +/app/GeoLite2-City.mmdb +``` + ### Get a WorldWeatherOnline key and configure wego To get a WorldWeatherOnline API key, you must register here: