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 (48 loc) · 1.73 KB
/
Dockerfile
File metadata and controls
63 lines (48 loc) · 1.73 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 \
ffmpeg \
git \
g++ \
cargo \
mktorrent \
mediainfo \
rustc \
mono-complete \
nano && \
rm -rf /var/lib/apt/lists/*
# 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 wheel requests
# Install Web UI dependencies (in venv)
RUN pip install --no-cache-dir flask flask-cors
# Set the working directory FIRST
WORKDIR /Upload-Assistant
# Copy DVD MediaInfo download script and run it
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 download script
COPY bin/download_mkbrr_for_docker.py bin/
RUN chmod +x bin/download_mkbrr_for_docker.py
# Download only the required mkbrr binary
RUN python3 bin/download_mkbrr_for_docker.py
# Copy the rest of the application (including web_ui)
COPY . .
# Ensure mkbrr is executable
RUN find bin/mkbrr -type f -name "mkbrr" -exec chmod +x {} \;
# Create tmp directory with appropriate permissions
RUN mkdir -p /Upload-Assistant/tmp && chmod 777 /Upload-Assistant/tmp
ENV TMPDIR=/Upload-Assistant/tmp
# Add environment variable to enable/disable Web UI
ENV ENABLE_WEB_UI=false
# Make entrypoint script executable
RUN chmod +x docker-entrypoint.sh
# Set the entry point for the container
ENTRYPOINT ["/Upload-Assistant/docker-entrypoint.sh"]
CMD ["python", "upload.py"]