Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y \ | |
| gcc \ | |
| g++ \ | |
| libgomp1 \ | |
| curl \ | |
| git \ | |
| git-lfs \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| COPY api/ ./api/ | |
| COPY data/ ./data/ | |
| COPY training/ ./training/ | |
| COPY scripts/ ./scripts/ | |
| RUN mkdir -p /app/models/regression \ | |
| /app/models/nlp/severity_classifier \ | |
| /app/models/nlp/indobert-base \ | |
| /app/models/seasonality \ | |
| /app/models/root_cause | |
| COPY scripts/download_models.py /tmp/download_models.py | |
| ARG HF_TOKEN | |
| ENV HF_TOKEN=${HF_TOKEN} | |
| RUN python /tmp/download_models.py && rm /tmp/download_models.py | |
| EXPOSE 7860 | |
| ENV PORT=7860 | |
| ENV API_HOST=0.0.0.0 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV NLP_ALLOW_TRANSFORMERS=true | |
| ENV NLP_PREFER_MULTITASK=false | |
| ENV SIMILARITY_USE_EMBEDDING=true | |
| ENV SIMILARITY_EMBED_BATCH=16 | |
| ENV HF_MODEL_REPO_ID=ridzki-nrzngr/gapura-ai-models | |
| ENV REGRESSION_MODEL_REPO_ID=ridzki-nrzngr/gapura-ai-models | |
| ENV ROOT_CAUSE_MODEL_REPO_ID=ridzki-nrzngr/gapura-ai-models | |
| ENV ONNX_USE_INT8=0 | |
| ENV ONNX_THREADS=1 | |
| ENV HF_HUB_DISABLE_TELEMETRY=1 | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| RUN chmod +x /app/scripts/start.sh | |
| CMD ["/app/scripts/start.sh"] | |