Spaces:
Build error
Build error
File size: 630 Bytes
865d27c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | FROM python:3.12-slim
# Set working directory
WORKDIR /code
# Install system dependencies if any are needed (e.g. for image processing)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy and install python dependencies
COPY requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy all application code to container
COPY . /code
# Expose Hugging Face default port
ENV PORT=7860
EXPOSE 7860
# Run FastAPI app with Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|