forked from Audionut/Upload-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (49 loc) · 2.08 KB
/
Dockerfile
File metadata and controls
63 lines (49 loc) · 2.08 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
FROM python:3.12
# Update the package list and install system dependencies including mono
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
g++ \
cargo \
ffmpeg \
mediainfo \
rustc \
nano \
ca-certificates \
curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
update-ca-certificates
# Set up a virtual environment to isolate our Python dependencies
RUN python -m venv /venv
ENV PATH="/venv/bin:$PATH"
# Install wheel, requests (for DVD MediaInfo download), and other Python dependencies
RUN pip install --upgrade pip==25.3 wheel==0.45.1 requests==2.32.5
# Set the working directory in the container
WORKDIR /Upload-Assistant
# Copy DVD MediaInfo download script and run it
# This downloads specialized MediaInfo binaries for DVD processing with language support
COPY bin/get_dvd_mediainfo_docker.py bin/
RUN python3 bin/get_dvd_mediainfo_docker.py
# Copy the Python requirements file and install Python dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the rest of the application
COPY . .
# Download only the required mkbrr binary (requires full repo for src imports)
RUN python3 -c "from bin.get_mkbrr import MkbrrBinaryManager; MkbrrBinaryManager.download_mkbrr_for_docker()"
# Ensure binaries are executable
RUN find bin/mkbrr -name "mkbrr" -print0 | xargs -0 chmod +x
# Download bdinfo binary for the container architecture using the docker helper
RUN python3 bin/get_bdinfo_docker.py
# Ensure bdinfo binaries are executable
RUN find bin/bdinfo -name "bdinfo" -print0 | xargs -0 chmod +x
# Enable non-root access while still letting Upload-Assistant tighten permissions at runtime
RUN chown -R 1000:1000 /Upload-Assistant/bin/mkbrr
RUN chown -R 1000:1000 /Upload-Assistant/bin/MI
RUN chown -R 1000:1000 /Upload-Assistant/bin/bdinfo
# Create tmp directory with appropriate permissions
RUN mkdir -p /Upload-Assistant/tmp && chmod 777 /Upload-Assistant/tmp
ENV TMPDIR=/Upload-Assistant/tmp
# Set the entry point for the container
ENTRYPOINT ["python", "/Upload-Assistant/upload.py"]