suraj-ml-projects commited on
Commit
3407c3d
Β·
verified Β·
1 Parent(s): 7c52b1b

Delete dockerfile.txt

Browse files
Files changed (1) hide show
  1. dockerfile.txt +0 -79
dockerfile.txt DELETED
@@ -1,79 +0,0 @@
1
- # ============================================================
2
- # CineAI Dockerfile
3
- # Base: Python 3.10 slim (smaller than full Python image)
4
- # Optimized for Hugging Face Spaces (CPU + optional T4 GPU)
5
- # ============================================================
6
-
7
- FROM python:3.10-slim
8
-
9
- # ── System packages ───────────────────────────────────────────────────────────
10
- RUN apt-get update && apt-get install -y --no-install-recommends \
11
- ffmpeg \
12
- libsndfile1 \
13
- libgl1-mesa-glx \
14
- libglib2.0-0 \
15
- libsm6 \
16
- libxext6 \
17
- libxrender-dev \
18
- libgomp1 \
19
- git \
20
- wget \
21
- curl \
22
- espeak-ng \
23
- espeak-ng-data \
24
- && rm -rf /var/lib/apt/lists/*
25
-
26
- # ── Working dir ───────────────────────────────────────────────────────────────
27
- WORKDIR /app
28
-
29
- # ── Python dependencies (cached layer) ───────────────────────────────────────
30
- COPY requirements.txt .
31
-
32
- # Install torch CPU first (smaller download for CI), then rest
33
- RUN pip install --no-cache-dir --upgrade pip wheel setuptools && \
34
- pip install --no-cache-dir \
35
- torch==2.3.1 \
36
- torchvision==0.18.1 \
37
- torchaudio==2.3.1 \
38
- --index-url https://download.pytorch.org/whl/cpu && \
39
- pip install --no-cache-dir -r requirements.txt
40
-
41
- # ── Copy project ──────────────────────────────────────────────────────────────
42
- COPY . .
43
-
44
- # ── Create temp dirs with correct permissions ─────────────────────────────────
45
- RUN mkdir -p /tmp/cineai && chmod 700 /tmp/cineai && \
46
- mkdir -p /root/.cache/cineai/whisper && \
47
- mkdir -p /root/.cache/cineai/vision && \
48
- mkdir -p /root/.cache/cineai/llm && \
49
- mkdir -p /root/.cache/cineai/nllb && \
50
- mkdir -p /root/.cache/cineai/tts
51
-
52
- # ── Hugging Face Spaces: user 1000 ───────────────────────────────────────────
53
- RUN useradd -m -u 1000 cineai && \
54
- chown -R cineai:cineai /app /tmp/cineai /root/.cache/cineai || true
55
-
56
- USER 1000
57
-
58
- # ── Environment ───────────────────────────────────────────────────────────────
59
- ENV PYTHONPATH=/app \
60
- PYTHONUNBUFFERED=1 \
61
- GRADIO_SERVER_NAME=0.0.0.0 \
62
- GRADIO_SERVER_PORT=7860 \
63
- TRANSFORMERS_CACHE=/root/.cache/cineai \
64
- HF_HOME=/root/.cache/cineai \
65
- CINEAI_TEMP_DIR=/tmp/cineai \
66
- SESSION_TTL_MINUTES=60 \
67
- TOKENIZERS_PARALLELISM=false \
68
- OMP_NUM_THREADS=4 \
69
- MKL_NUM_THREADS=4
70
-
71
- # ── Expose port ───────────────────────────────────────────────────────────────
72
- EXPOSE 7860
73
-
74
- # ── Health check ──────────────────────────────────────────────────────────────
75
- HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
76
- CMD curl -f http://localhost:7860/ || exit 1
77
-
78
- # ── Entry point ───────────────────────────────────────────────────────────────
79
- CMD ["python", "app.py"]