diff --git a/Dockerfile b/Dockerfile index 4345d83..d981c25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,24 +8,13 @@ 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 # 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 @@ -34,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 \ @@ -42,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 && \ @@ -61,19 +51,12 @@ 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 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" 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: