# Use the official Python image as base FROM python:3.9-slim # Set the working directory in the container WORKDIR /app # Copy the requirements file into the container at /app COPY requirements.txt ./requirements.txt # Install system dependencies RUN apt-get update \ && apt-get -y install libpq-dev gcc \ && rm -rf /var/lib/apt/lists/* # Install psycopg2 RUN pip install psycopg2 # Install uvicorn RUN pip install uvicorn # Install Python dependencies RUN pip install -r requirements.txt # Copy the current directory contents into the container at /app COPY . /app # Set the entry point for running the application with Uvicorn ENTRYPOINT ["uvicorn", "main:app"] # Specify default command arguments for Uvicorn CMD ["--host", "0.0.0.0", "--port", "7860"]