-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
39 lines (26 loc) · 968 Bytes
/
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
FROM python:3 as base
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1
# Build virtual env
FROM base as builder
ENV PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.3.0
RUN pip install "poetry==$POETRY_VERSION"
RUN python -m venv /venv
ENV VIRTUAL_ENV="/venv"
WORKDIR /app
COPY poetry.lock pyproject.toml ./
RUN poetry install -n --no-ansi --no-root -E origin
COPY . ./
RUN poetry build && /venv/bin/pip install dist/*.whl
# Install into final image
FROM base as final
ENV PATH="/venv/bin:${PATH}"
ENV VIRTUAL_ENV="/venv"
RUN bash -c 'echo -e "[Main]\nbaseURL=https://passthepopcorn.me/\ndownloadDirectory=/data/" > ~/.ptpapi.conf'
RUN curl -sSL https://github.com/bcicen/tinycron/releases/download/v0.4/tinycron-0.4-linux-amd64 > /usr/local/bin/tinycron && chmod +x /usr/local/bin/tinycron
COPY ./resources/archiver.sh /usr/local/bin/
COPY --from=builder /venv /venv