FROM python:3.11-slim RUN apt-get update && \ apt-get install -y --no-install-recommends ca-certificates && \ rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . ENV PING_URL=http://127.0.0.1:7860/health ENV PING_INTERVAL=240 ENV PYTHONUNBUFFERED=1 EXPOSE 7860 CMD ["sh", "-c", "python pinger.py & uvicorn app:app --host 0.0.0.0 --port 7860"]