FROM python:3.9-slim WORKDIR /app COPY requirements.txt ./requirements.txt RUN apt-get update \ && apt-get -y install libpq-dev gcc \ && pip install psycopg2 # Install uvicorn RUN pip install uvicorn # Use an official PostgreSQL image FROM postgres:16 # Set environment variables ENV POSTGRES_DB ai ENV POSTGRES_USER ai ENV POSTGRES_PASSWORD ai # Mount a volume for storing data VOLUME pgvolume # Expose port 5532 EXPOSE 5532 # Run the container in detached mode CMD ["docker", "run", "-d", "--name", "pgvector", "phidata/pgvector:16"] RUN ollama pull nomic-embed-text # Install dependencies RUN pip install -r requirements.txt COPY . /app ENTRYPOINT ["uvicorn", "main:app"] CMD ["--host", "0.0.0.0", "--port", "7860"]