File size: 747 Bytes
9eff8a5
 
 
 
 
 
bc35817
9eff8a5
1d2bb6a
bc35817
9eff8a5
 
 
 
 
1d2bb6a
bc35817
de43742
9eff8a5
 
bc35817
9eff8a5
 
bc35817
de43742
618322a
bc35817
de43742
bdc06d0
dc4d8a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set the working directory
WORKDIR /workspace

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first (to leverage Docker caching)
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application files
COPY . .

# Expose port 7860 (port used by Hugging Face Spaces)
EXPOSE 7860

# Start the server using uvicorn and the ASGI wrapper
CMD ["python", "app.py"]