Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +36 -0
Dockerfile
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Base image with Python 3.11 and CUDA (for GPU support; remove/change if CPU-only)
|
2 |
+
FROM python:3.11-slim
|
3 |
+
|
4 |
+
# Set environment variables
|
5 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
6 |
+
PYTHONUNBUFFERED=1 \
|
7 |
+
PIP_NO_CACHE_DIR=1
|
8 |
+
|
9 |
+
# Install system dependencies
|
10 |
+
RUN apt-get update && apt-get install -y \
|
11 |
+
git \
|
12 |
+
ffmpeg \
|
13 |
+
libsm6 \
|
14 |
+
libxext6 \
|
15 |
+
libgl1-mesa-glx \
|
16 |
+
build-essential \
|
17 |
+
&& rm -rf /var/lib/apt/lists/*
|
18 |
+
|
19 |
+
# Install git-lfs and initialize (if needed by olmocr)
|
20 |
+
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
|
21 |
+
apt-get install -y git-lfs && git lfs install
|
22 |
+
|
23 |
+
# Set working directory
|
24 |
+
WORKDIR /app
|
25 |
+
|
26 |
+
# Copy requirement files
|
27 |
+
COPY requirements.txt .
|
28 |
+
|
29 |
+
# Install Python dependencies
|
30 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
31 |
+
|
32 |
+
# Copy application code
|
33 |
+
COPY . .
|
34 |
+
|
35 |
+
# Run Gradio app
|
36 |
+
CMD ["python", "app.py"]
|