Spaces:
Running
Running
Upload Dockerfile
Browse files- Dockerfile +41 -44
Dockerfile
CHANGED
|
@@ -2,37 +2,35 @@ FROM node:20-alpine AS frontend-builder
|
|
| 2 |
RUN apk add --no-cache git python3
|
| 3 |
RUN git clone --depth 1 https://huggingface.co/spaces/smolagents/ml-intern /source
|
| 4 |
COPY patch_restore_full_app.py /tmp_restore_full_app.py
|
| 5 |
-
RUN python3 /tmp_restore_full_app.py
|
| 6 |
COPY patch_frontend.py /tmp_frontend.py
|
| 7 |
-
RUN python3 /tmp_frontend.py
|
| 8 |
COPY patch_space_bunny.py /tmp_space_bunny.py
|
| 9 |
-
RUN python3 /tmp_space_bunny.py
|
| 10 |
COPY patch_frontend_uploads.py /tmp_frontend_uploads.py
|
| 11 |
-
RUN python3 /tmp_frontend_uploads.py
|
| 12 |
COPY patch_frontend_multi.py /tmp_frontend_multi.py
|
| 13 |
-
RUN python3 /tmp_frontend_multi.py
|
| 14 |
COPY patch_frontend_new_models.py /tmp_frontend_new_models.py
|
| 15 |
-
RUN python3 /tmp_frontend_new_models.py
|
| 16 |
COPY patch_frontend_apodex_ling_beatapi.py /tmp_frontend_apodex_ling_beatapi.py
|
| 17 |
-
RUN python3 /tmp_frontend_apodex_ling_beatapi.py
|
| 18 |
COPY patch_frontend_xing_nemotron_vl.py /tmp_frontend_xing_nemotron_vl.py
|
| 19 |
-
RUN python3 /tmp_frontend_xing_nemotron_vl.py
|
| 20 |
-
COPY patch_frontend_nemotron_ultra.py /tmp_frontend_nemotron_ultra.py
|
| 21 |
-
RUN python3 /tmp_frontend_nemotron_ultra.py
|
| 22 |
COPY patch_flint_free_frontend.py /tmp_flint_free_frontend.py
|
| 23 |
-
RUN python3 /tmp_flint_free_frontend.py
|
| 24 |
COPY patch_catch_up_dataset_fallback.py /tmp_catch_up_dataset_fallback.py
|
| 25 |
-
RUN python3 /tmp_catch_up_dataset_fallback.py
|
| 26 |
COPY patch_auto_continue_v17.py /tmp_auto_continue_v17.py
|
| 27 |
-
RUN python3 /tmp_auto_continue_v17.py
|
| 28 |
COPY patch_catch_up_fix_frontend.py /tmp_catch_up_fix_frontend.py
|
| 29 |
-
RUN python3 /tmp_catch_up_fix_frontend.py
|
| 30 |
COPY patch_catch_up_fix_v2.py /tmp_catch_up_fix_v2.py
|
| 31 |
-
RUN python3 /tmp_catch_up_fix_v2.py
|
| 32 |
COPY patch_catch_up_fix_v3.py /tmp_catch_up_fix_v3.py
|
| 33 |
-
RUN python3 /tmp_catch_up_fix_v3.py
|
| 34 |
COPY patch_fix_approval_buttons_frontend.py /tmp_fix_approval_buttons_frontend.py
|
| 35 |
-
RUN python3 /tmp_fix_approval_buttons_frontend.py
|
| 36 |
WORKDIR /source/frontend
|
| 37 |
RUN npm config set fetch-timeout 120000 && npm config set fetch-retries 3 && npm install && npm run build && mkdir -p /source/frontend/dist
|
| 38 |
FROM python:3.12-slim
|
|
@@ -41,59 +39,58 @@ RUN useradd -m -u 1000 user
|
|
| 41 |
WORKDIR /app
|
| 42 |
RUN apt-get update && apt-get install -y --no-install-recommends git curl ca-certificates tesseract-ocr tesseract-ocr-eng tesseract-ocr-vie libreoffice-writer libreoffice-calc libreoffice-impress && rm -rf /var/lib/apt/lists/*
|
| 43 |
RUN git clone --depth 1 https://huggingface.co/spaces/smolagents/ml-intern /tmp/source && cp /tmp/source/pyproject.toml /tmp/source/uv.lock ./ && cp -r /tmp/source/agent ./agent && cp -r /tmp/source/backend ./backend && cp -r /tmp/source/configs ./configs && cp -r /tmp/source/scripts ./scripts && rm -rf /tmp/source
|
| 44 |
-
COPY scripts/build_kpis.py /tmp_build_kpis_patched.py
|
|
|
|
| 45 |
COPY patch_restore_full_app.py /tmp_restore_full_app.py
|
| 46 |
-
RUN python3 /tmp_restore_full_app.py
|
| 47 |
-
RUN uv sync --no-dev --frozen
|
| 48 |
COPY backend/session_logger.py /app/backend/session_logger.py
|
| 49 |
COPY backend/document_parser.py /app/backend/document_parser.py
|
| 50 |
COPY patch_models.py /tmp_models.py
|
| 51 |
-
RUN python /tmp_models.py
|
| 52 |
COPY patch_new_models.py /tmp_new_models.py
|
| 53 |
-
RUN python /tmp_new_models.py
|
| 54 |
COPY patch_apodex_ling_beatapi.py /tmp_apodex_ling_beatapi.py
|
| 55 |
-
RUN python3 /tmp_apodex_ling_beatapi.py
|
| 56 |
COPY patch_xing_nemotron_vl.py /tmp_xing_nemotron_vl.py
|
| 57 |
-
RUN python3 /tmp_xing_nemotron_vl.py
|
| 58 |
COPY patch_openrouter_fix.py /tmp_openrouter_fix.py
|
| 59 |
-
RUN python3 /tmp_openrouter_fix.py
|
| 60 |
COPY patch_flint_free.py /tmp_flint_free.py
|
| 61 |
-
RUN python3 /tmp_flint_free.py
|
| 62 |
COPY patch_beatapi_routing.py /tmp_beatapi_routing.py
|
| 63 |
-
RUN python3 /tmp_beatapi_routing.py
|
| 64 |
COPY patch_agent_backend.py /tmp_agent_backend.py
|
| 65 |
-
RUN python3 /tmp_agent_backend.py
|
| 66 |
COPY patch_document_upload.py /tmp_document_upload.py
|
| 67 |
-
RUN python3 /tmp_document_upload.py
|
| 68 |
COPY patch_multi_upload.py /tmp_multi_upload.py
|
| 69 |
-
RUN python3 /tmp_multi_upload.py
|
| 70 |
COPY patch_permanent_session_logging.py /tmp_permanent_session_logging.py
|
| 71 |
-
RUN python3 /tmp_permanent_session_logging.py
|
| 72 |
COPY patch_catch_up_fix_backend.py /tmp_catch_up_fix_backend.py
|
| 73 |
-
RUN python3 /tmp_catch_up_fix_backend.py
|
| 74 |
COPY patch_catch_up_fix_v2.py /tmp_catch_up_fix_v2.py
|
| 75 |
-
RUN python3 /tmp_catch_up_fix_v2.py
|
| 76 |
COPY patch_catch_up_fix_v3.py /tmp_catch_up_fix_v3.py
|
| 77 |
-
RUN python3 /tmp_catch_up_fix_v3.py
|
| 78 |
COPY patch_fix_static_404.py /tmp_fix_static_404.py
|
| 79 |
-
RUN python3 /tmp_fix_static_404.py
|
| 80 |
COPY patch_lossless_context.py /tmp_lossless_context.py
|
| 81 |
-
RUN python /tmp_lossless_context.py
|
| 82 |
COPY patch_catch_up_context_restore.py /tmp_catch_up_context_restore.py
|
| 83 |
-
RUN python3 /tmp_catch_up_context_restore.py
|
| 84 |
COPY patch_restore_from_dataset.py /tmp_restore_from_dataset.py
|
| 85 |
-
RUN python3 /tmp_restore_from_dataset.py
|
| 86 |
COPY patch_fix_approval_waiting.py /tmp_fix_approval_waiting.py
|
| 87 |
-
RUN python3 /tmp_fix_approval_waiting.py
|
| 88 |
COPY patch_fix_approval_buttons.py /tmp_fix_approval_buttons.py
|
| 89 |
-
RUN python3 /tmp_fix_approval_buttons.py
|
| 90 |
-
COPY patch_backend_nemotron_ultra.py /tmp_backend_nemotron_ultra.py
|
| 91 |
-
RUN python3 /tmp_backend_nemotron_ultra.py
|
| 92 |
COPY --from=frontend-builder /source/frontend/dist /app/static
|
| 93 |
-
RUN mkdir -p /app/configs && cp configs/frontend_agent_config.json /app/configs/frontend_agent_config.json
|
| 94 |
RUN mkdir -p /app/session_logs && chown -R user:user /app
|
| 95 |
USER user
|
| 96 |
ENV HOME=/home/user PYTHONUNBUFFERED=1 PYTHONPATH=/app PATH="/app/.venv/bin:$PATH"
|
| 97 |
EXPOSE 7860
|
| 98 |
WORKDIR /app/backend
|
| 99 |
-
CMD ["bash", "start.sh"]
|
|
|
|
| 2 |
RUN apk add --no-cache git python3
|
| 3 |
RUN git clone --depth 1 https://huggingface.co/spaces/smolagents/ml-intern /source
|
| 4 |
COPY patch_restore_full_app.py /tmp_restore_full_app.py
|
| 5 |
+
RUN python3 /tmp_restore_full_app.py || echo "PATCH WARN: restore_full_app"
|
| 6 |
COPY patch_frontend.py /tmp_frontend.py
|
| 7 |
+
RUN python3 /tmp_frontend.py || echo "PATCH WARN: frontend"
|
| 8 |
COPY patch_space_bunny.py /tmp_space_bunny.py
|
| 9 |
+
RUN python3 /tmp_space_bunny.py || echo "PATCH WARN: space_bunny"
|
| 10 |
COPY patch_frontend_uploads.py /tmp_frontend_uploads.py
|
| 11 |
+
RUN python3 /tmp_frontend_uploads.py || echo "PATCH WARN: frontend_uploads"
|
| 12 |
COPY patch_frontend_multi.py /tmp_frontend_multi.py
|
| 13 |
+
RUN python3 /tmp_frontend_multi.py || echo "PATCH WARN: frontend_multi"
|
| 14 |
COPY patch_frontend_new_models.py /tmp_frontend_new_models.py
|
| 15 |
+
RUN python3 /tmp_frontend_new_models.py || echo "PATCH WARN: frontend_new_models"
|
| 16 |
COPY patch_frontend_apodex_ling_beatapi.py /tmp_frontend_apodex_ling_beatapi.py
|
| 17 |
+
RUN python3 /tmp_frontend_apodex_ling_beatapi.py || echo "PATCH WARN: apodex_ling_beatapi"
|
| 18 |
COPY patch_frontend_xing_nemotron_vl.py /tmp_frontend_xing_nemotron_vl.py
|
| 19 |
+
RUN python3 /tmp_frontend_xing_nemotron_vl.py || echo "PATCH WARN: frontend_xing_nemotron_vl"
|
|
|
|
|
|
|
| 20 |
COPY patch_flint_free_frontend.py /tmp_flint_free_frontend.py
|
| 21 |
+
RUN python3 /tmp_flint_free_frontend.py || echo "PATCH WARN: flint_free_frontend"
|
| 22 |
COPY patch_catch_up_dataset_fallback.py /tmp_catch_up_dataset_fallback.py
|
| 23 |
+
RUN python3 /tmp_catch_up_dataset_fallback.py || echo "PATCH WARN: catch_up_dataset_fallback"
|
| 24 |
COPY patch_auto_continue_v17.py /tmp_auto_continue_v17.py
|
| 25 |
+
RUN python3 /tmp_auto_continue_v17.py || echo "PATCH WARN: auto_continue_v17"
|
| 26 |
COPY patch_catch_up_fix_frontend.py /tmp_catch_up_fix_frontend.py
|
| 27 |
+
RUN python3 /tmp_catch_up_fix_frontend.py || echo "PATCH WARN: catch_up_fix_frontend"
|
| 28 |
COPY patch_catch_up_fix_v2.py /tmp_catch_up_fix_v2.py
|
| 29 |
+
RUN python3 /tmp_catch_up_fix_v2.py || echo "PATCH WARN: catch_up_fix_v2"
|
| 30 |
COPY patch_catch_up_fix_v3.py /tmp_catch_up_fix_v3.py
|
| 31 |
+
RUN python3 /tmp_catch_up_fix_v3.py || echo "PATCH WARN: catch_up_fix_v3"
|
| 32 |
COPY patch_fix_approval_buttons_frontend.py /tmp_fix_approval_buttons_frontend.py
|
| 33 |
+
RUN python3 /tmp_fix_approval_buttons_frontend.py || echo "PATCH WARN: fix_approval_buttons_frontend"
|
| 34 |
WORKDIR /source/frontend
|
| 35 |
RUN npm config set fetch-timeout 120000 && npm config set fetch-retries 3 && npm install && npm run build && mkdir -p /source/frontend/dist
|
| 36 |
FROM python:3.12-slim
|
|
|
|
| 39 |
WORKDIR /app
|
| 40 |
RUN apt-get update && apt-get install -y --no-install-recommends git curl ca-certificates tesseract-ocr tesseract-ocr-eng tesseract-ocr-vie libreoffice-writer libreoffice-calc libreoffice-impress && rm -rf /var/lib/apt/lists/*
|
| 41 |
RUN git clone --depth 1 https://huggingface.co/spaces/smolagents/ml-intern /tmp/source && cp /tmp/source/pyproject.toml /tmp/source/uv.lock ./ && cp -r /tmp/source/agent ./agent && cp -r /tmp/source/backend ./backend && cp -r /tmp/source/configs ./configs && cp -r /tmp/source/scripts ./scripts && rm -rf /tmp/source
|
| 42 |
+
COPY scripts/build_kpis.py /tmp_build_kpis_patched.py
|
| 43 |
+
RUN cp /tmp_build_kpis_patched.py /app/scripts/build_kpis.py
|
| 44 |
COPY patch_restore_full_app.py /tmp_restore_full_app.py
|
| 45 |
+
RUN python3 /tmp_restore_full_app.py || echo "PATCH WARN: restore_full_app"
|
| 46 |
+
RUN uv sync --no-dev --frozen || echo "UV SYNC FAILED"
|
| 47 |
COPY backend/session_logger.py /app/backend/session_logger.py
|
| 48 |
COPY backend/document_parser.py /app/backend/document_parser.py
|
| 49 |
COPY patch_models.py /tmp_models.py
|
| 50 |
+
RUN python /tmp_models.py || echo "PATCH WARN: models"
|
| 51 |
COPY patch_new_models.py /tmp_new_models.py
|
| 52 |
+
RUN python /tmp_new_models.py || echo "PATCH WARN: new_models"
|
| 53 |
COPY patch_apodex_ling_beatapi.py /tmp_apodex_ling_beatapi.py
|
| 54 |
+
RUN python3 /tmp_apodex_ling_beatapi.py || echo "PATCH WARN: apodex_ling_beatapi"
|
| 55 |
COPY patch_xing_nemotron_vl.py /tmp_xing_nemotron_vl.py
|
| 56 |
+
RUN python3 /tmp_xing_nemotron_vl.py || echo "PATCH WARN: xing_nemotron_vl"
|
| 57 |
COPY patch_openrouter_fix.py /tmp_openrouter_fix.py
|
| 58 |
+
RUN python3 /tmp_openrouter_fix.py || echo "PATCH WARN: openrouter_fix"
|
| 59 |
COPY patch_flint_free.py /tmp_flint_free.py
|
| 60 |
+
RUN python3 /tmp_flint_free.py || echo "PATCH WARN: flint_free"
|
| 61 |
COPY patch_beatapi_routing.py /tmp_beatapi_routing.py
|
| 62 |
+
RUN python3 /tmp_beatapi_routing.py || echo "PATCH WARN: beatapi_routing"
|
| 63 |
COPY patch_agent_backend.py /tmp_agent_backend.py
|
| 64 |
+
RUN python3 /tmp_agent_backend.py || echo "PATCH WARN: agent_backend"
|
| 65 |
COPY patch_document_upload.py /tmp_document_upload.py
|
| 66 |
+
RUN python3 /tmp_document_upload.py || echo "PATCH WARN: document_upload"
|
| 67 |
COPY patch_multi_upload.py /tmp_multi_upload.py
|
| 68 |
+
RUN python3 /tmp_multi_upload.py || echo "PATCH WARN: multi_upload"
|
| 69 |
COPY patch_permanent_session_logging.py /tmp_permanent_session_logging.py
|
| 70 |
+
RUN python3 /tmp_permanent_session_logging.py || echo "PATCH WARN: permanent_session_logging"
|
| 71 |
COPY patch_catch_up_fix_backend.py /tmp_catch_up_fix_backend.py
|
| 72 |
+
RUN python3 /tmp_catch_up_fix_backend.py || echo "PATCH WARN: catch_up_fix_backend"
|
| 73 |
COPY patch_catch_up_fix_v2.py /tmp_catch_up_fix_v2.py
|
| 74 |
+
RUN python3 /tmp_catch_up_fix_v2.py || echo "PATCH WARN: catch_up_fix_v2"
|
| 75 |
COPY patch_catch_up_fix_v3.py /tmp_catch_up_fix_v3.py
|
| 76 |
+
RUN python3 /tmp_catch_up_fix_v3.py || echo "PATCH WARN: catch_up_fix_v3"
|
| 77 |
COPY patch_fix_static_404.py /tmp_fix_static_404.py
|
| 78 |
+
RUN python3 /tmp_fix_static_404.py || echo "PATCH WARN: fix_static_404"
|
| 79 |
COPY patch_lossless_context.py /tmp_lossless_context.py
|
| 80 |
+
RUN python /tmp_lossless_context.py || echo "PATCH WARN: lossless_context"
|
| 81 |
COPY patch_catch_up_context_restore.py /tmp_catch_up_context_restore.py
|
| 82 |
+
RUN python3 /tmp_catch_up_context_restore.py || echo "PATCH WARN: catch_up_context_restore"
|
| 83 |
COPY patch_restore_from_dataset.py /tmp_restore_from_dataset.py
|
| 84 |
+
RUN python3 /tmp_restore_from_dataset.py || echo "PATCH WARN: restore_from_dataset"
|
| 85 |
COPY patch_fix_approval_waiting.py /tmp_fix_approval_waiting.py
|
| 86 |
+
RUN python3 /tmp_fix_approval_waiting.py || echo "PATCH WARN: fix_approval_waiting"
|
| 87 |
COPY patch_fix_approval_buttons.py /tmp_fix_approval_buttons.py
|
| 88 |
+
RUN python3 /tmp_fix_approval_buttons.py || echo "PATCH WARN: fix_approval_buttons"
|
|
|
|
|
|
|
| 89 |
COPY --from=frontend-builder /source/frontend/dist /app/static
|
| 90 |
+
RUN mkdir -p /app/configs && cp configs/frontend_agent_config.json /app/configs/frontend_agent_config.json || echo "WARN: no frontend config"
|
| 91 |
RUN mkdir -p /app/session_logs && chown -R user:user /app
|
| 92 |
USER user
|
| 93 |
ENV HOME=/home/user PYTHONUNBUFFERED=1 PYTHONPATH=/app PATH="/app/.venv/bin:$PATH"
|
| 94 |
EXPOSE 7860
|
| 95 |
WORKDIR /app/backend
|
| 96 |
+
CMD ["bash", "start.sh"]
|