EYEDOL commited on
Commit
71f2d36
Β·
verified Β·
1 Parent(s): db24fa9

Delete Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +0 -60
Dockerfile DELETED
@@ -1,60 +0,0 @@
1
- # ─────────────────────────────────────────────────────────────────────────────
2
- # Dockerfile for HuggingFace Spaces (Docker SDK)
3
- #
4
- # Hardware target: CPU Space (free tier) or GPU Space (T4-small recommended).
5
- # Port 7860 is the HF Spaces standard.
6
- #
7
- # Build order:
8
- # 1. System deps (libsndfile for soundfile, git for pip installs)
9
- # 2. Python packages (cached layer)
10
- # 3. App code (invalidates only on source changes)
11
- # 4. Switch to non-root user (HF Spaces requirement)
12
- # ─────────────────────────────────────────────────────────────────────────────
13
-
14
- FROM python:3.11-slim
15
-
16
- WORKDIR /app
17
-
18
- # ── System dependencies ───────────────────────────────────────────────────── #
19
- RUN apt-get update && apt-get install -y --no-install-recommends \
20
- libsndfile1 \
21
- libgomp1 \
22
- git \
23
- && rm -rf /var/lib/apt/lists/*
24
-
25
- # ── Python dependencies (cached unless requirements.txt changes) ──────────── #
26
- COPY requirements.txt .
27
-
28
- # Install CPU-only torch first (saves ~1 GB over default CUDA wheel).
29
- # Comment these two lines out and use the plain pip install if you have a GPU Space.
30
- RUN pip install --no-cache-dir \
31
- torch==2.5.1+cpu torchaudio==2.5.1+cpu \
32
- --index-url https://download.pytorch.org/whl/cpu
33
-
34
- RUN pip install --no-cache-dir -r requirements.txt
35
-
36
- # ── Application code ─────────────────────────────────────────────────────── #
37
- COPY . .
38
-
39
- # ── Non-root user for HF Spaces compatibility ─────────────────────────────── #
40
- RUN useradd -m -u 1000 appuser \
41
- && chown -R appuser:appuser /app
42
- USER 1000
43
-
44
- # ── Model cache lives in the user home so HF Spaces can persist it ────────── #
45
- ENV HF_HOME=/home/appuser/.cache/huggingface
46
- ENV TRANSFORMERS_CACHE=/home/appuser/.cache/huggingface/hub
47
- ENV PORT=7860
48
-
49
- EXPOSE 7860
50
-
51
- # ── Healthcheck ───────────────────────────────────────────────────────────── #
52
- HEALTHCHECK --interval=60s --timeout=10s --start-period=300s \
53
- CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')"
54
-
55
- CMD ["python", "-m", "uvicorn", "app:app", \
56
- "--host", "0.0.0.0", \
57
- "--port", "7860", \
58
- "--log-level", "info", \
59
- "--ws-ping-interval", "30", \
60
- "--ws-ping-timeout", "60"]