File size: 680 Bytes
7616a39 d49c909 7616a39 65c604f 7616a39 d49c909 7616a39 d49c909 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# Use the official Python 3.11 slim image as a base
FROM python:3.11-slim
# Prevent Python from buffering stdout/stderr (so logs appear immediately)
ENV PYTHONUNBUFFERED=1
# Set the working directory inside the container
WORKDIR /app
# Copy only requirements first to leverage Docker layer caching
COPY requirements.txt .
# Upgrade pip, install all Python dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt
# Copy the rest of the application code
COPY . .
# Expose port 7860 for Hugging Face Spaces
EXPOSE 7860
# Run the app on port 7860 (REQUIRED for Hugging Face)
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |