File size: 616 Bytes
c6769c2 1a20c41 | 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 | # Use Python 3.9 or 3.10 (Slim version to save space)
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Copy files
COPY requirements.txt .
# Install dependencies
# We add --no-cache-dir to keep the image small
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create the directory for models if it doesn't exist
RUN mkdir -p models
# Expose port 7860 (Hugging Face default)
EXPOSE 7860
# Command to run the app
# Note: Hugging Face expects the app on port 7860, not 8000
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |