-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (58 loc) · 2.54 KB
/
Copy pathDockerfile
File metadata and controls
74 lines (58 loc) · 2.54 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# --------------------------------------------------------------------------- #
# Stage 1 - Dependencies #
# --------------------------------------------------------------------------- #
FROM python:3.13-slim
# Install ca-certificates for SSL
RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy uv related files for dependency installation
COPY ./.python-version /app/.python-version
COPY ./pyproject.toml /app/pyproject.toml
COPY ./uv.lock /app/uv.lock
# Install Python dependencies using uv pip install
RUN uv pip install --no-cache --native-tls --system -r pyproject.toml
# Install ffmpeg using install_ffmpeg.sh script
COPY ./scripts/install_ffmpeg.sh /tmp/install_ffmpeg.sh
RUN chmod +x /tmp/install_ffmpeg.sh && /tmp/install_ffmpeg.sh
# Copy gosu from gosu image to allow running as non-root user
COPY --from=tianon/gosu:trixie /usr/local/bin/gosu /usr/local/bin/gosu
RUN chmod +x /usr/local/bin/gosu
# # Copy uv, ffmpeg and Python dependencies from python-deps stage to make it available in final image
# COPY --from=python-deps /usr/local/bin/ /usr/local/bin/
# COPY --from=python-deps /usr/local/lib/python3.13/site-packages/ /usr/local/lib/python3.13/site-packages/
# Install HW Acceleration drivers and libraries
COPY ./scripts/install_drivers.sh /tmp/install_drivers.sh
RUN chmod +x /tmp/install_drivers.sh && \
/tmp/install_drivers.sh
# ARG APP_VERSION, will be set during build by github actions
ARG IMAGE_VERSION=250101
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
TZ="America/New_York" \
IMAGE_VERSION=${IMAGE_VERSION} \
NVIDIA_VISIBLE_DEVICES="all" \
NVIDIA_DRIVER_CAPABILITIES="all"
# Install tzdata and pciutils, set timezone
RUN apt-get update && apt-get install -y \
curl p7zip-full \
tzdata \
pciutils \
udev \
&& \
ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
rm -rf /var/lib/apt/lists/*
# Install Deno for use with yt-dlp - install globally for all users
RUN curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh && \
chmod +x /usr/local/bin/deno && \
/usr/local/bin/deno --version
# Set the working directory
# WORKDIR /app
# Copy the project folders and files
# COPY . /app
# Run a command to keep the container running for testing purposes
CMD ["sleep", "infinity"]