Spaces:
Sleeping
Sleeping
# Use Python 3.11 as the base image | |
# FROM python:3.11 | |
FROM python:3.11-slim | |
# Set the working directory inside the container | |
WORKDIR /app | |
# Copy all project files into the container | |
COPY . /app | |
RUN mkdir -p /app/logs && chmod -R 777 /app/logs | |
# Install dependencies | |
RUN pip install --upgrade pip | |
# Disable cache for pip installs | |
RUN pip install --no-cache-dir -r requirement.txt | |
# Set PYTHONPATH so FastAPI can find the 'backend' module | |
ENV PYTHONPATH=/app | |
# Expose the required port | |
EXPOSE 7860 | |
# Start FastAPI with the correct module path | |
# CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"] | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |