-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (27 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
40 lines (27 loc) · 1.11 KB
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
FROM python:3.12.9-bookworm AS builder
RUN pip install poetry==2.1.2
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN touch README.md
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --no-root
FROM python:3.12.9-slim-bookworm AS runtime
RUN pip install poetry==2.1.2
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY . ./app/
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get -y update && \
apt-get -y install --no-install-recommends \
git ffmpeg gpg nodejs mono-runtime xz-utils
ADD https://github.com/arcusmaximus/YTSubConverter/releases/download/1.6.3/YTSubConverter-Linux.tar.xz /app/ytsubconverter/a.tar.xz
RUN tar -xf /app/ytsubconverter/a.tar.xz -C /app/ytsubconverter && \
rm /app/ytsubconverter/a.tar.xz && \
apt-get purge -y --auto-remove xz-utils && \
rm -rf /var/lib/apt/lists/*
CMD ["python", "-u", "app/main.py"]