Akash4911 commited on
Commit
7f4fce1
Β·
1 Parent(s): ee5f182

Fix: Restore full build with correct libgl1 package

Browse files
Files changed (2) hide show
  1. Dockerfile +24 -3
  2. requirements.txt +1 -0
Dockerfile CHANGED
@@ -1,20 +1,41 @@
1
  FROM python:3.10-slim
2
 
3
- ENV PYTHONUNBUFFERED=1
 
 
 
4
 
5
  WORKDIR /app
6
 
 
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  libgl1 \
9
  libglib2.0-0 \
10
  libsndfile1 \
11
  ffmpeg \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- RUN echo "Hello world" > test.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  COPY . .
17
 
18
  EXPOSE 7860
19
 
20
- CMD ["python", "-m", "http.server", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ ENV PYTHONUNBUFFERED=1 \
4
+ PYTHONUTF8=1 \
5
+ PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python \
6
+ FAKESHIELD_SKIP_WARMUP=0
7
 
8
  WORKDIR /app
9
 
10
+ # System dependencies
11
  RUN apt-get update && apt-get install -y --no-install-recommends \
12
  libgl1 \
13
  libglib2.0-0 \
14
  libsndfile1 \
15
  ffmpeg \
16
+ libmagic1 \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ COPY requirements.txt .
20
+
21
+ # Step 1: Core web framework (fast, small)
22
+ RUN pip install --no-cache-dir --upgrade pip && \
23
+ pip install --no-cache-dir fastapi "uvicorn[standard]" python-multipart python-dotenv pydantic "pydantic-settings" motor "passlib[bcrypt]" PyJWT google-generativeai
24
+
25
+ # Step 2: PyTorch CPU-only (large but isolated for caching)
26
+ RUN pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu
27
+
28
+ # Step 3: ML/AI packages
29
+ RUN pip install --no-cache-dir transformers accelerate "sentence-transformers" scikit-learn numpy scipy
30
+
31
+ # Step 4: Image/Audio packages
32
+ RUN pip install --no-cache-dir Pillow piexif opencv-python-headless "soundfile>=0.12.0" "librosa>=0.10.0" "resampy>=0.4.2"
33
+
34
+ # Step 5: Heavy optional packages
35
+ RUN pip install --no-cache-dir "pyannote.audio>=3.1.0" "protobuf~=4.25.3" python-magic
36
 
37
  COPY . .
38
 
39
  EXPOSE 7860
40
 
41
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -36,3 +36,4 @@ google-generativeai
36
 
37
  # ── Misc ────────────────────────────────────────────────────────────
38
  protobuf~=4.25.3
 
 
36
 
37
  # ── Misc ────────────────────────────────────────────────────────────
38
  protobuf~=4.25.3
39
+ python-magic