-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·32 lines (25 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
executable file
·32 lines (25 loc) · 1.06 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
FROM nvidia/cuda:12.3.2-base-ubuntu22.04
COPY requirements.txt entrypoint.sh /
# --- FIX 1: Install gosu ---
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg python3 python3-pip curl gosu tzdata \
&& python3 -m pip install -U --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cu124 \
&& python3 -m pip install -U --no-cache-dir -r requirements.txt \
&& apt-get purge -y --auto-remove python3-pip \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/*
WORKDIR /subgen
# Copy files
COPY launcher.py subgen.py language_code.py /subgen/
# --- FIX 2: Create a dedicated cache directory ---
# This prevents the app from trying to write to root-owned /.cache
RUN mkdir -p /cache && chmod 777 /cache
# --- FIX 3: Set Environment Vars to use the new cache ---
# This forces HuggingFace and Matplotlib to write to our writable folder
ENV XDG_CACHE_HOME=/cache \
HF_HOME=/cache/huggingface \
MPLCONFIGDIR=/cache/matplotlib \
PYTHONUNBUFFERED=1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["python3", "launcher.py"]