FROM python:3.11-bullseye # Install system dependencies required for WeasyPrint and other dependencies RUN apt-get update && apt-get install -y \ libglib2.0-0 \ libcairo2 \ libpango1.0-0 \ libffi-dev \ libglib2.0-dev \ && rm -rf /var/lib/apt/lists/* # Clean up to reduce the image size # Set the working directory for the application WORKDIR /app # Copy the requirements.txt file into the container COPY requirements.txt . # Install Python dependencies using the requirements.txt file RUN python3 -m pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code into the container COPY . . # Expose the port that Uvicorn will run on EXPOSE 7860 # Start the Uvicorn server with the specified app entry point CMD ["python3", "-m", "uvicorn", "src.api:app", "--host", "0.0.0.0", "--port", "7860"]