Spaces:
Running
Running
FROM python:3.10-slim | |
# Set environment variables | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
ENV PYTHONUNBUFFERED=1 | |
# Set workdir | |
WORKDIR /code | |
# Install dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy all app code | |
COPY app app | |
# Expose port (Spaces expect 7860 or 8080 to be open) | |
EXPOSE 7860 | |
# Start the FastAPI app using uvicorn | |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |