FROM python:3.11-slim RUN apt-get update && apt-get install -y --no-install-recommends curl libpq-dev && rm -rf /var/lib/apt/lists/* WORKDIR /app RUN pip install \ fastapi>=0.104.0 \ uvicorn>=0.24.0 \ pydantic>=2.0 \ requests>=2.31.0 \ psycopg2-binary>=2.9.0 COPY manager/ /app/manager/ COPY entrypoint.sh /app/ RUN mkdir -p /tmp/data && chmod -R 777 /tmp RUN chmod +x /app/entrypoint.sh HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \ CMD curl -f http://localhost:7860/health || exit 1 EXPOSE 7860 CMD ["/app/entrypoint.sh"]