-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
45 lines (34 loc) · 1.04 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
FROM python:3.11-slim as builder
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.3.1 \
POETRY_VIRTUALENVS_CREATE=0
RUN pip install "poetry==$POETRY_VERSION"
WORKDIR /app
COPY poetry.lock pyproject.toml /app/
RUN poetry install --no-interaction --no-ansi --only main
COPY README.md /app/
COPY knowit/ /app/knowit/
RUN poetry build --no-interaction --no-ansi
FROM python:3.11-slim
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100
RUN apt-get update \
&& apt-get install -y --no-install-recommends mediainfo ffmpeg mkvtoolnix \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/dist /usr/src/dist
RUN pip install /usr/src/dist/knowit-*.tar.gz
WORKDIR /
ENTRYPOINT ["knowit"]
CMD ["--help"]