Gift / Dockerfile
Mubspro54's picture
Upload 4 files
71f1328 verified
Raw
History Blame Contribute Delete
541 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies needed for some Python packages
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY main.py .
# Hugging Face Spaces requires port 7860
EXPOSE 7860
# Start the FastAPI server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]