vikramvasudevan commited on
Commit
fa724d4
·
verified ·
1 Parent(s): 95474d1
Files changed (2) hide show
  1. Dockerfile +27 -20
  2. requirements.txt +0 -0
Dockerfile CHANGED
@@ -1,27 +1,34 @@
1
- FROM python:3.13.6
2
 
3
- # Avoid running as root
4
- RUN useradd -m -u 1000 user
5
- USER user
6
- ENV PATH="/home/user/.local/bin:$PATH"
7
 
8
- WORKDIR /app
9
-
10
- # Install system dependencies needed to build packages like pydantic-core
11
- RUN apt-get update && apt-get install -y \
12
- build-essential \
13
- curl \
14
  git \
15
- libssl-dev \
16
- && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- # Copy requirements and install
19
- COPY --chown=user requirements.txt .
20
- RUN pip install --upgrade pip
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # Copy app
24
- COPY --chown=user . /app
 
25
 
26
- # HF Spaces expects port 7860 or 8080; using 7860
27
- CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.12-slim
2
 
3
+ # Avoid interactive prompts during build
4
+ ENV DEBIAN_FRONTEND=noninteractive
 
 
5
 
6
+ # Install system dependencies with libGL auto-detection
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
 
 
 
 
8
  git \
9
+ git-lfs \
10
+ ffmpeg \
11
+ libsm6 \
12
+ libxext6 \
13
+ cmake \
14
+ rsync \
15
+ && if apt-cache show libgl1 >/dev/null 2>&1; then \
16
+ apt-get install -y libgl1; \
17
+ elif apt-cache show libgl1-mesa-glx >/dev/null 2>&1; then \
18
+ apt-get install -y libgl1-mesa-glx; \
19
+ else \
20
+ echo "ERROR: Neither libgl1 nor libgl1-mesa-glx found" && exit 1; \
21
+ fi \
22
+ && rm -rf /var/lib/apt/lists/* \
23
+ && git lfs install
24
 
25
+ # Copy dependency file & install Python packages
26
+ COPY requirements.txt .
 
27
  RUN pip install --no-cache-dir -r requirements.txt
28
 
29
+ # Copy source code
30
+ COPY . /app
31
+ WORKDIR /app
32
 
33
+ # Default command (Gradio, Streamlit, or Python)
34
+ CMD ["python", "app.py"]
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ