# Use an official Python runtime as a parent image FROM python:3.9-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Set the working directory in the container WORKDIR /app # Copy requirements.txt into the container COPY requirements.txt /app/ # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Create a pic directory in the root of the app RUN mkdir -p /app/pic # Copy the entire app into the container COPY . /app/ # Expose the port your app runs on EXPOSE 7860 # Command to run the FastAPI app with uvicorn CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]