Update Dockerfile
Browse files- Dockerfile +13 -22
Dockerfile
CHANGED
@@ -1,39 +1,30 @@
|
|
1 |
-
#
|
2 |
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
|
3 |
|
4 |
-
# System
|
5 |
RUN apt-get update && \
|
6 |
-
apt-get install -y
|
7 |
-
|
8 |
-
wget curl procps gnupg \
|
9 |
-
cmake \
|
10 |
-
htop vim nano && \
|
11 |
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
-
# Non
|
14 |
RUN useradd -m -u 1000 user
|
15 |
USER user
|
16 |
WORKDIR /app
|
17 |
ENV PATH="/home/user/.local/bin:$PATH"
|
18 |
-
#ENV HF_HOME=/app/.cache # HF‑Cache in deinem Schreibverzeichnis
|
19 |
|
20 |
# Python-Abhängigkeiten
|
21 |
COPY --chown=user requirements.txt .
|
22 |
RUN pip install --upgrade pip && \
|
23 |
pip install --no-cache-dir -r requirements.txt
|
24 |
|
25 |
-
#
|
26 |
-
# fertiges Wheel laden (kein nvcc)
|
27 |
-
RUN pip install --no-cache-dir \
|
28 |
-
https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.2cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
|
29 |
-
|
30 |
-
# Mount das geheime HF‑Token beim Build:
|
31 |
-
# Settings → Secrets → Name: HF_TOKEN (scope: "read")
|
32 |
-
#ARG HF_TOKEN
|
33 |
-
#RUN --mount=type=secret,id=HF_TOKEN \
|
34 |
-
# echo "machine huggingface.co login __token__ password $(cat /run/secrets/HF_TOKEN)" > ~/.netrc
|
35 |
-
|
36 |
-
# App‑Code
|
37 |
COPY --chown=user . /app
|
38 |
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# PyTorch + CUDA 12.1 + cuDNN 8 (passt zur L4)
|
2 |
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
|
3 |
|
4 |
+
# -- System-Pakete minimal, aber was wir wirklich brauchen --
|
5 |
RUN apt-get update && \
|
6 |
+
apt-get install -y --no-install-recommends \
|
7 |
+
git-lfs build-essential portaudio19-dev ffmpeg && \
|
|
|
|
|
|
|
8 |
rm -rf /var/lib/apt/lists/*
|
9 |
|
10 |
+
# Non-root-User (Spaces-Empfehlung)
|
11 |
RUN useradd -m -u 1000 user
|
12 |
USER user
|
13 |
WORKDIR /app
|
14 |
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
15 |
|
16 |
# Python-Abhängigkeiten
|
17 |
COPY --chown=user requirements.txt .
|
18 |
RUN pip install --upgrade pip && \
|
19 |
pip install --no-cache-dir -r requirements.txt
|
20 |
|
21 |
+
# Orpheus-/SNAC-Code + Server
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
COPY --chown=user . /app
|
23 |
|
24 |
+
# GPU-freundliches Torch-Upgrade (falls gewünscht)
|
25 |
+
RUN pip install --no-cache-dir \
|
26 |
+
torch==2.3.1+cu121 torchaudio==2.3.1 \
|
27 |
+
--index-url https://download.pytorch.org/whl/cu121
|
28 |
+
|
29 |
+
EXPOSE 7860
|
30 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|