Browse Source

dockerized project

pull/406/head
Kuspanov Nurbek 6 years ago
parent
commit
dd5bfaffbe
7 changed files with 1269 additions and 1 deletions
  1. +2
    -0
      .gitignore
  2. +0
    -0
      .ip2location.key
  3. +7
    -0
      .wegorc
  4. +54
    -0
      Dockerfile
  5. +3
    -1
      requirements.txt
  6. +22
    -0
      supervisord.conf
  7. +1181
    -0
      we-lang.go

+ 2
- 0
.gitignore View File

@ -5,3 +5,5 @@ data/
log/
.idea/
*.swp
*.mmdb
*.dat

+ 0
- 0
.ip2location.key View File


+ 7
- 0
.wegorc View File

@ -0,0 +1,7 @@
{
"APIKey": "",
"City": "London",
"Numdays": 3,
"Imperial": false,
"Lang": "en"
}

+ 54
- 0
Dockerfile View File

@ -0,0 +1,54 @@
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 ./GeoLite2-City.mmdb /app
COPY ./requirements.txt /app
COPY ./.wegorc /root
COPY ./we-lang.go /app
COPY ./.ip2location.key /root
COPY ./airports.dat /app
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
COPY supervisord.conf /etc/supervisor/supervisord.conf
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"]

+ 3
- 1
requirements.txt View File

@ -7,7 +7,7 @@ dnspython
pylint
cyrtranslit
astral
timezonefinder
timezonefinder==2.1.2
Pillow
pyte
python-dateutil
@ -16,4 +16,6 @@ pyjq
scipy
babel
pylru
pysocks
supervisor
numba

+ 22
- 0
supervisord.conf View File

@ -0,0 +1,22 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
[program:srv]
command=python /app/bin/srv.py
stderr_logfile=/var/log/supervisor/srv-stderr.log
stdout_logfile=/var/log/supervisor/srv-stdout.log
[program:proxy]
command=python /app/bin/proxy.py
stderr_logfile=/var/log/supervisor/proxy-stderr.log
stdout_logfile=/var/log/supervisor/proxy-stdout.log
[program:geoproxy]
command=python /app/bin/geo-proxy.py
stderr_logfile=/var/log/supervisor/geoproxy-stderr.log
stdout_logfile=/var/log/supervisor/geoproxy-stdout.log
[include]
files=/etc/supervisor/conf.d/*.conf

+ 1181
- 0
we-lang.go
File diff suppressed because it is too large
View File


Loading…
Cancel
Save