This repository was archived by the owner on Sep 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (43 loc) · 1.62 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (43 loc) · 1.62 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ---- Builder Stage ----
FROM python:3.14-slim as builder
ARG DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends git
WORKDIR /app
# Create and activate a virtual environment
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Install Python dependencies into the virtual environment
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy application code
COPY ytm_takeout_downloader.py /app/ytm_takeout_downloader.py
COPY convert_csv_to_takeout_json.py /app/convert_csv_to_takeout_json.py
COPY get_cookies/get_cookies.py /app/get_cookies.py
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# ---- Final Stage ----
FROM python:3.14-slim
ARG BUILD_DATE
ARG VERSION
ARG VCS_REF
LABEL org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}
# System deps
RUN bash -euxo pipefail -c '\
printf "Acquire::Retries \"5\";\nAcquire::ForceIPv4 \"true\";\n" > /etc/apt/apt.conf.d/99acquire; \
apt-get update; \
apt-get install -y --no-install-recommends ffmpeg ca-certificates; \
rm -rf /var/lib/apt/lists/* \
'
WORKDIR /app
# Copy virtual environment and application code from builder stage
COPY --from=builder /opt/venv /opt/venv
COPY --from=builder /app /app
# Set path to use the virtual environment's Python
ENV PATH="/opt/venv/bin:$PATH"
ENV PYTHONUNBUFFERED=1
VOLUME ["/data", "/library"]
ENTRYPOINT ["/app/entrypoint.sh"]