content: # Use official Python runtime as a parent image
  FROM python:3.12-slim
  
  # Set working directory in the container
  WORKDIR /app
  
  # Install system dependencies
  RUN apt-get update && apt-get install -y \
      gcc \
      libpq-dev \
      && rm -rf /var/lib/apt/lists/*
  
  # Copy requirements first to leverage Docker cache
  COPY requirements.txt .
  
  # Install Python dependencies
  RUN pip install --no-cache-dir -r requirements.txt
  
  # Copy the backend code into the container
  COPY . .
  
  # Expose port for FastAPI
  EXPOSE 8080
  
  # Command to run the application
  CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT:-8080}"]