2022-05-31 15:28:45 +02:00
|
|
|
FROM python:3.10-alpine
|
2020-11-25 19:35:39 +01:00
|
|
|
|
|
|
|
WORKDIR /usr/src/
|
|
|
|
|
2020-12-03 16:30:29 +01:00
|
|
|
# setting the correct timezone requires "zdtata"
|
|
|
|
# numpy (dependency of matplotlib) requires "make automake gcc ..."
|
|
|
|
# source: https://stackoverflow.com/a/48349161/6334421
|
|
|
|
# pillow (dependency of matplotlib) requires "zlib-dev jpeg-dev ..."
|
2020-11-29 15:39:11 +01:00
|
|
|
RUN apk update && \
|
|
|
|
apk add \
|
|
|
|
tzdata \
|
|
|
|
make automake gcc g++ subversion python3-dev \
|
|
|
|
zlib-dev jpeg-dev freetype-dev lcms2-dev libwebp-dev tcl-dev tk-dev harfbuzz-dev \
|
|
|
|
fribidi-dev libimagequant-dev libxcb-dev && \
|
|
|
|
rm -rf /var/cache/apk/*
|
|
|
|
|
|
|
|
# source: https://serverfault.com/a/683651/537998
|
|
|
|
ENV TZ=Europe/Berlin
|
|
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
|
2020-12-03 16:30:29 +01:00
|
|
|
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
2020-11-29 16:33:16 +01:00
|
|
|
|
2020-11-29 15:39:11 +01:00
|
|
|
# LDFLAGS required for "pip install pillow"
|
|
|
|
# otherwise this would be necessary:
|
|
|
|
## RUN ln -s /usr/lib/x86_64-linux-gnu/libz.so /lib/
|
|
|
|
## RUN ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /lib/
|
|
|
|
# source: https://github.com/python-pillow/Pillow/issues/3103#issuecomment-382634946
|
|
|
|
ENV LDFLAGS=-L/usr/lib/x86_64-linux-gnu/
|
|
|
|
|
2020-12-03 16:30:29 +01:00
|
|
|
COPY requirements.txt ./
|
|
|
|
RUN python3 -m pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
#
|
|
|
|
# if the above fails, try using the below instead
|
|
|
|
#
|
|
|
|
#RUN python3 -m pip install --no-cache-dir --upgrade requests
|
|
|
|
#RUN python3 -m pip install --no-cache-dir --upgrade setuptools
|
|
|
|
#RUN python3 -m pip install --no-cache-dir --upgrade numpy
|
|
|
|
#RUN python3 -m pip install --no-cache-dir --upgrade pillow
|
|
|
|
#RUN python3 -m pip install --no-cache-dir --upgrade matplotlib
|
|
|
|
|
|
|
|
COPY src/ ./
|
|
|
|
RUN chmod +x langfingaz/main.py
|
2020-11-25 19:35:39 +01:00
|
|
|
|
2020-11-25 19:59:43 +01:00
|
|
|
# unbuffered output option otherwise script sleeps before any output appears
|
2020-11-29 15:39:11 +01:00
|
|
|
# python -u
|
2020-11-29 17:55:43 +01:00
|
|
|
ENTRYPOINT [ "python", "./langfingaz/main.py" ]
|
2020-11-29 15:39:11 +01:00
|
|
|
CMD [ "log-verbose" ]
|