| FROM python:3.12-slim | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl nginx supervisor && rm -rf /var/lib/apt/lists/* | |
| COPY tonj-core-mvp/tonj-core/requirements.txt ./requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY tonj-core-mvp/tonj-core/ . | |
| RUN mkdir -p outputs/traces | |
| COPY spaces/tonj-core/nginx.conf /etc/nginx/nginx.conf | |
| COPY spaces/tonj-core/supervisord.conf /etc/supervisor/conf.d/tonj.conf | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=20s --timeout=5s --start-period=15s \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| CMD ["supervisord", "-c", "/etc/supervisor/conf.d/tonj.conf"] | |