-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (55 loc) · 1.67 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM python:3.8 as base
ARG FONTS_PATH=/usr/local/share/fonts/Ubuntu
ARG FONTS_URL=https://github.com/kiddten/getcam/raw/master/fonts/Ubuntu.zip
RUN apt-get update && apt-get install -y \
curl \
software-properties-common \
python3-launchpadlib \
fontconfig \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p $FONTS_PATH \
&& wget -q -O $FONTS_PATH/tmp.zip $FONTS_URL \
&& unzip $FONTS_PATH/tmp.zip -d $FONTS_PATH \
&& rm $FONTS_PATH/tmp.zip \
&& fc-cache -f -v \
&& sed -i 's/none/read,write/g' /etc/ImageMagick-6/policy.xml
ENV \
# python:
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PYTHONDONTWRITEBYTECODE=1 \
# pip:
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=100 \
PIP_ROOT_USER_ACTION=ignore \
# poetry:
POETRY_VERSION=1.7.1 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_HOME='/usr/local'
RUN \
# Installing `poetry` package manager:
# https://github.com/python-poetry/poetry
curl -sSL 'https://install.python-poetry.org' | python - \
&& poetry --version
WORKDIR /app
ENV TZ="Europe/Moscow"
FROM base as bump-lock-prepare
COPY ./pyproject.toml /app/
RUN poetry lock
FROM scratch AS bump-lock
COPY --from=bump-lock-prepare /app/poetry.lock .
FROM base as build
COPY pyproject.toml poetry.lock /app/
# Install project dependencies
RUN poetry version \
# Install deps:
&& poetry run pip install -U pip \
&& poetry install -vvv --no-interaction --no-ansi
COPY . /app
# https://stackoverflow.com/a/76747791/3990145
RUN poetry install --no-interaction --no-ansi
CMD ["poetry", "run", "python", "-m", "shot.shot", "run"]