2020-02-17 13:57:08 +00:00
|
|
|
FROM ubuntu:18.04
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y curl \
|
|
|
|
git \
|
|
|
|
python \
|
|
|
|
python-pip \
|
|
|
|
python-dev \
|
|
|
|
autoconf \
|
|
|
|
libtool \
|
|
|
|
gawk
|
|
|
|
RUN curl -O https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
|
|
|
|
RUN tar xvf go1.10.3.linux-amd64.tar.gz
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY ./bin /app/bin
|
|
|
|
COPY ./lib /app/lib
|
|
|
|
COPY ./share /app/share
|
|
|
|
COPY ./requirements.txt /app
|
2020-02-17 21:19:09 +00:00
|
|
|
COPY ./src/we-lang/we-lang.go /app
|
|
|
|
|
|
|
|
# There are several files that must be fetched/created manually
|
|
|
|
# before building the image
|
2020-02-17 13:57:08 +00:00
|
|
|
COPY ./.wegorc /root
|
|
|
|
COPY ./.ip2location.key /root
|
|
|
|
COPY ./airports.dat /app
|
2020-02-17 21:19:09 +00:00
|
|
|
COPY ./GeoLite2-City.mmdb /app
|
2020-02-17 13:57:08 +00:00
|
|
|
|
|
|
|
RUN export PATH=$PATH:/go/bin && \
|
|
|
|
go get -u github.com/mattn/go-colorable && \
|
|
|
|
go get -u github.com/klauspost/lctime && \
|
|
|
|
go get -u github.com/mattn/go-runewidth && \
|
|
|
|
export GOBIN="/root/go/bin" && \
|
|
|
|
go install /app/we-lang.go
|
|
|
|
|
|
|
|
RUN pip install -r requirements.txt
|
|
|
|
|
|
|
|
RUN mkdir /app/cache
|
|
|
|
RUN mkdir -p /var/log/supervisor && \
|
|
|
|
mkdir -p /etc/supervisor/conf.d
|
|
|
|
RUN chmod -R o+rw /var/log/supervisor && \
|
|
|
|
chmod -R o+rw /var/run
|
2020-02-17 21:19:09 +00:00
|
|
|
COPY share/docker/supervisord.conf /etc/supervisor/supervisord.conf
|
2020-02-17 13:57:08 +00:00
|
|
|
|
|
|
|
ENV WTTR_MYDIR="/app"
|
|
|
|
ENV WTTR_GEOLITE="/app/GeoLite2-City.mmdb"
|
|
|
|
ENV WTTR_WEGO="/root/go/bin/we-lang"
|
|
|
|
ENV WTTR_LISTEN_HOST="0.0.0.0"
|
|
|
|
ENV WTTR_LISTEN_PORT="8002"
|
|
|
|
|
|
|
|
EXPOSE 8002
|
|
|
|
|
|
|
|
CMD ["/usr/local/bin/supervisord"]
|