Merge pull request #524 from SuperSandro2000/docker-review
Docker review
This commit is contained in:
commit
54d71beea2
2 changed files with 25 additions and 29 deletions
41
Dockerfile
41
Dockerfile
|
|
@ -8,24 +8,13 @@ COPY ./share/we-lang/we-lang.go /app
|
||||||
RUN apk add --no-cache git
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
|
|
||||||
RUN true && \
|
RUN go get -u github.com/mattn/go-colorable && \
|
||||||
go get -u github.com/mattn/go-colorable && \
|
|
||||||
go get -u github.com/klauspost/lctime && \
|
go get -u github.com/klauspost/lctime && \
|
||||||
go get -u github.com/mattn/go-runewidth && \
|
go get -u github.com/mattn/go-runewidth && \
|
||||||
CGO_ENABLED=0 go build /app/we-lang.go
|
CGO_ENABLED=0 go build /app/we-lang.go
|
||||||
# Results in /app/we-lang
|
# 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
|
FROM alpine:3
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -34,7 +23,16 @@ COPY ./requirements.txt /app
|
||||||
|
|
||||||
ENV LLVM_CONFIG=/usr/bin/llvm9-config
|
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 \
|
python3 \
|
||||||
py3-pip \
|
py3-pip \
|
||||||
py3-scipy \
|
py3-scipy \
|
||||||
|
|
@ -42,17 +40,9 @@ RUN apk add --no-cache \
|
||||||
py3-gevent \
|
py3-gevent \
|
||||||
zlib \
|
zlib \
|
||||||
jpeg \
|
jpeg \
|
||||||
gcc \
|
|
||||||
g++ \
|
|
||||||
llvm9 \
|
llvm9 \
|
||||||
make \
|
|
||||||
autoconf \
|
|
||||||
automake \
|
|
||||||
libtool \
|
libtool \
|
||||||
supervisor \
|
supervisor \
|
||||||
zlib-dev \
|
|
||||||
jpeg-dev \
|
|
||||||
llvm9-dev \
|
|
||||||
py3-numpy-dev \
|
py3-numpy-dev \
|
||||||
python3-dev && \
|
python3-dev && \
|
||||||
mkdir -p /app/cache && \
|
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/log/supervisor && \
|
||||||
chmod -R o+rw /var/run && \
|
chmod -R o+rw /var/run && \
|
||||||
pip install -r requirements.txt && \
|
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 --from=builder /app/we-lang /app/bin/we-lang
|
||||||
COPY ./bin /app/bin
|
COPY ./bin /app/bin
|
||||||
COPY ./lib /app/lib
|
COPY ./lib /app/lib
|
||||||
COPY ./share /app/share
|
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
|
COPY share/docker/supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
ENV WTTR_MYDIR="/app"
|
ENV WTTR_MYDIR="/app"
|
||||||
|
|
|
||||||
13
README.md
13
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,
|
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).
|
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
|
### Get a WorldWeatherOnline key and configure wego
|
||||||
|
|
||||||
To get a WorldWeatherOnline API key, you must register here:
|
To get a WorldWeatherOnline API key, you must register here:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue