From c3d5473123787f19869fb16b6278e38426fa6333 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Mon, 27 Jul 2020 21:06:14 +0300 Subject: [PATCH] Use Python3 to fetch cheat sheets --- Dockerfile | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 347b515..05c7dd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,24 @@ -FROM alpine:3.10 -WORKDIR /app -COPY requirements.txt /app/ -RUN apk add --update --no-cache python2 py2-pip py2-gevent \ - py2-flask py2-requests py2-pygments py2-redis \ - py2-cffi py2-icu bash vim gawk sed \ - && apk add --no-cache --virtual build-deps python2-dev \ - build-base git \ - && pip install -r requirements.txt \ - && apk del build-deps -COPY . /app +FROM alpine:latest # fetching cheat sheets -RUN apk add --update --no-cache git \ - && mkdir -p /root/.cheat.sh/log/ \ - && python2 lib/fetch.py fetch-all -ENTRYPOINT ["python2"] +## installing dependencies +RUN apk add --update --no-cache git py3-six py3-pygments py3-yaml py3-gevent \ + libstdc++ py3-colorama py3-requests py3-icu py3-redis +## building missing python packages +RUN apk add --no-cache --virtual build-deps py3-pip g++ python3-dev \ + && pip3 install rapidfuzz colored polyglot pycld2 \ + && apk del build-deps +## copying +WORKDIR /app +COPY . /app +RUN mkdir -p /root/.cheat.sh/log/ \ + && python3 lib/fetch.py fetch-all + +# installing server dependencies +#RUN apk add --update --no-cache py3-cffi py2-pip py2-gevent \ +# py2-flask py2-requests py2-pygments py2-redis \ +# py2-cffi py2-icu bash vim gawk sed \ +# && apk add --no-cache --virtual build-deps python3-dev build-base \ +# && pip3 install -r requirements.txt \ +# && apk del build-deps +ENTRYPOINT ["python3"] CMD ["bin/srv.py"]