Download Dockerfile from VoiceOfML/Search: direct link, hf CLI and curl.
- Browser
- Download file 10.3 kB
-
https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/VoiceOfML/Search/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/Dockerfile
10.3 kB
| # Pin the published generation for reproducible builds without build arguments. | |
| # An explicit SEARCH_DATA_GENERATION selects another immutable bucket generation. | |
| FROM node:26.13.1-bookworm-slim AS search-generation | |
| ARG SEARCH_DATA_GENERATION=5c80388b465f35f74711c17aef9e31f8bb1c04fc0553e9820ac271658d740639 | |
| WORKDIR /build | |
| COPY scripts/data/fetch_search_generation.mjs /build/fetch_search_generation.mjs | |
| RUN node /build/fetch_search_generation.mjs "$SEARCH_DATA_GENERATION" space /selected \ | |
| && printf '%s\n' "$SEARCH_DATA_GENERATION" > /requested-generation | |
| FROM node:26.13.1-bookworm-slim AS source-check-node | |
| WORKDIR /check | |
| COPY package.json package-lock.json eslint.config.mjs jsconfig.json pyrightconfig.json pyrightconfig.strict.json ./ | |
| COPY config/types/ config/types/ | |
| RUN apt-get update && apt-get install -y --no-install-recommends python3 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN npm ci --ignore-scripts --no-audit --no-fund | |
| COPY static/ static/ | |
| COPY scripts/ scripts/ | |
| COPY tests/ tests/ | |
| COPY backend/ backend/ | |
| COPY quality/ quality/ | |
| COPY typings/ typings/ | |
| COPY app.py ./ | |
| COPY --from=search-generation /selected/ /check/data/ | |
| RUN npm run check:static \ | |
| && node --test tests/data/test_search_generation_fetch.mjs | |
| FROM python:3.15.2-slim-trixie AS source-check-python | |
| WORKDIR /check | |
| COPY requirements.txt ruff.toml ./ | |
| COPY config/dependencies/static-check.txt config/dependencies/static-check.txt | |
| RUN pip install --no-cache-dir -r config/dependencies/static-check.txt | |
| COPY app.py ./ | |
| COPY backend/ backend/ | |
| COPY typings/ typings/ | |
| COPY scripts/ scripts/ | |
| COPY tests/ tests/ | |
| # Runtime import mounts both directories even when the tests use in-memory | |
| # generation fixtures; copy the real static shell for that contract. | |
| COPY static/ static/ | |
| COPY --from=search-generation /selected/ /check/data/ | |
| COPY --from=search-generation /requested-generation /tmp/requested-generation | |
| RUN python -B -m scripts.search_data_config /check/data > /tmp/selected-generation \ | |
| && test "$(cat /tmp/selected-generation)" = "$(cat /tmp/requested-generation)" | |
| RUN python -B scripts/check_python_static.py \ | |
| && pip install --no-cache-dir -r requirements.txt \ | |
| && python -B -m unittest -v \ | |
| tests.search.backend.test_search_data_selector \ | |
| tests.search.backend.test_search_data_selector_faults \ | |
| tests.performance.test_search_compute_benchmark \ | |
| tests.search.backend.test_search_runtime_entry \ | |
| tests.search.backend.test_search_start_script | |
| FROM node:26.13.1-trixie-slim AS static-gate-test | |
| WORKDIR /check | |
| # Use the source-checked Python and matching Debian runtime libraries, not | |
| # extension modules built for a different interpreter or distribution. | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libbz2-1.0 libcrypt1 libexpat1 libffi8 libgdbm-compat4t64 libgdbm6t64 \ | |
| liblzma5 libncursesw6 libreadline8t64 libsqlite3-0 libssl3t64 libuuid1 zlib1g \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY --from=source-check-node /check/ /check/ | |
| COPY --from=source-check-python /usr/local/ /usr/local/ | |
| COPY ruff.toml ./ | |
| COPY config/dependencies/static-check.txt config/dependencies/static-check.txt | |
| RUN python3 -B -c 'import sys, bz2, ctypes, lzma, sqlite3, ssl, coverage; assert sys.version_info[:3] == (3, 15, 2)' | |
| RUN npx --no-install pyright --project pyrightconfig.json \ | |
| && npx --no-install pyright --project pyrightconfig.strict.json \ | |
| && python3 -B -m unittest -v tests.gates.test_static_shards_runner tests.gates.test_package_resolution tests.gates.test_audit_source_transition \ | |
| && python3 -B scripts/ci/run_static_gate_shards.py --project hf \ | |
| && node scripts/search/check_search_file_types_coverage.mjs \ | |
| && node scripts/search/check_search_response_validation_coverage.mjs \ | |
| && node scripts/search/check_search_result_identity_coverage.mjs \ | |
| && node scripts/search/check_search_folder_selection_coverage.mjs \ | |
| && node scripts/search/check_search_height_index_coverage.mjs \ | |
| && node scripts/search/check_search_stable_stringify_coverage.mjs \ | |
| && node scripts/search/check_search_view_key_coverage.mjs \ | |
| && node scripts/search/check_search_recovery_coverage.mjs \ | |
| && node scripts/search/check_search_window_page_coverage.mjs \ | |
| && node scripts/search/check_sidebar_markup_coverage.mjs \ | |
| && node --test tests/search/baselines/test_search_extension_inventory_baseline.mjs tests/search/baselines/test_search_extension_filter_baseline.mjs \ | |
| && node --test tests/search/baselines/test_search_response_validation_baseline.mjs \ | |
| && node --test tests/search/baselines/test_search_stable_id_baseline.mjs \ | |
| && node --test tests/search/baselines/test_search_folder_selection_baseline.mjs \ | |
| && node scripts/search/check_search_filter_equality_baseline.mjs \ | |
| && node scripts/search/check_search_folder_merge_baseline.mjs \ | |
| && node scripts/reader/check_reader_lifecycle_coverage.mjs \ | |
| && node scripts/reader/check_reader_media_coverage.mjs \ | |
| && node scripts/reader/check_reader_text_coverage.mjs \ | |
| && node scripts/reader/check_reader_v3_coverage.mjs \ | |
| && node scripts/reader/check_reader_v3_mutations.mjs \ | |
| && node scripts/reader/check_pdf_book_client_coverage.mjs \ | |
| && node scripts/reader/check_pdf_book_url_coverage.mjs \ | |
| && node scripts/reader/check_pdf_search_stream_coverage.mjs \ | |
| && node scripts/reader/check_pdf_partition_shape_coverage.mjs \ | |
| && node scripts/reader/check_pdf_partition_config_coverage.mjs \ | |
| && node scripts/reader/check_pdf_partition_policy_coverage.mjs \ | |
| && node scripts/reader/check_pdf_partition_page_coverage.mjs \ | |
| && node scripts/reader/check_pdf_partition_requests_coverage.mjs \ | |
| && node scripts/reader/check_pdf_book_compact_coverage.mjs \ | |
| && node scripts/reader/check_pdf_search_decode_coverage.mjs \ | |
| && node scripts/reader/check_pdf_book_validate_coverage.mjs \ | |
| && node scripts/reader/check_pdf_prefetch_contracts.mjs \ | |
| && node scripts/reader/check_pdf_text_store_coverage.mjs \ | |
| && node scripts/reader/check_pdf_text_store_mutations.mjs \ | |
| && node --test tests/reader/pdf-search/test_pdf_book_worker.mjs \ | |
| && node --test tests/reader/pdf-network/test_pdf_range_cache_release.mjs \ | |
| && node scripts/reader/check_reader_djvu_contracts.mjs \ | |
| && node scripts/reader/check_chapter_search_core_coverage.mjs \ | |
| && node scripts/reader/check_chapter_search_proxy_coverage.mjs \ | |
| && node scripts/reader/check_chapter_search_index_coverage.mjs \ | |
| && node scripts/reader/check_chapter_search_worker_coverage.mjs \ | |
| && node --test tests/gates/test_tap_contracts.mjs \ | |
| && node tests/reader/pdf-v3/test_dataset_primary_policy.mjs \ | |
| && node scripts/search/check_download_controller_coverage.mjs \ | |
| && printf 'static gate tests passed\n' >/check/static-gate-test-ok | |
| FROM node:26.13.1-bookworm-slim AS static-assets | |
| ARG ESBUILD_VERSION=0.28.2 | |
| ARG READER_BUILD_REV=20261009-reader-proxy-cleanup | |
| WORKDIR /build | |
| RUN printf '%s\n' "$READER_BUILD_REV" >/tmp/reader-build-rev | |
| # Make source checks and their regression tests mandatory without shipping tools. | |
| COPY --from=static-gate-test /check/static-gate-test-ok /tmp/checked-static-gate-test-ok | |
| RUN npm install --global "esbuild@${ESBUILD_VERSION}" \ | |
| && test "$(esbuild --version)" = "${ESBUILD_VERSION}" | |
| COPY static/ /build/static/ | |
| COPY scripts/build/build_static_assets.mjs /build/build_static_assets.mjs | |
| COPY scripts/build/copy_reader_vendor.mjs /build/copy_reader_vendor.mjs | |
| COPY scripts/build/check_reader_release.mjs /build/check_reader_release.mjs | |
| COPY scripts/build/compose_app.mjs /build/compose_app.mjs | |
| COPY scripts/build/compile_static_assets.mjs /build/compile_static_assets.mjs | |
| COPY --from=source-check-python /tmp/selected-generation /build/verified-search-generation | |
| RUN mkdir -p /out \ | |
| && cp -a static/. /out/ \ | |
| && node /build/copy_reader_vendor.mjs /out/vendor \ | |
| && node /build/compose_app.mjs > /build/app-composed.js \ | |
| && esbuild /build/app-composed.js --minify --target=es2020 --charset=utf8 --legal-comments=none --outfile=/out/app.js \ | |
| && node /build/compile_static_assets.mjs hf /build /out esbuild \ | |
| && STATIC_SEARCH_DATA_GENERATION="$(cat /build/verified-search-generation)" node /build/build_static_assets.mjs \ | |
| && esbuild /out/sw.js --minify --target=es2019 --charset=utf8 --legal-comments=none --outfile=/out/sw.min.js \ | |
| && mv /out/sw.min.js /out/sw.js | |
| RUN node /build/check_reader_release.mjs --project hf --root /build --artifact-root /out | |
| FROM python:3.15.2-slim-trixie AS search-index-build | |
| WORKDIR /build | |
| RUN apt-get update && apt-get install -y --no-install-recommends gcc libc6-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY backend/native/search_index_native.c backend/native/search_index_native.c | |
| COPY scripts/build/build_search_index_native.py scripts/build/build_search_index_native.py | |
| RUN python scripts/build/build_search_index_native.py --output-dir /native | |
| # Verify the downloaded corpus/index bytes and Unicode matching assumptions | |
| # with the production Python version. Inherit the exact source-checked data. | |
| FROM source-check-python AS search-index-verified | |
| WORKDIR /check | |
| COPY --from=search-index-build /native/ /check/ | |
| RUN python -B -m unittest -v \ | |
| tests.search.backend.test_wildcard_index_oracle.WildcardIndexOracleTests.test_generated_index_is_exact_for_metadata_fields \ | |
| tests.search.backend.test_wildcard_index_oracle.WildcardIndexOracleTests.test_semantically_changed_but_well_formed_indexes_fail_the_oracle \ | |
| tests.search.backend.test_wildcard_index_oracle.WildcardIndexOracleTests.test_unicode_engine_has_no_equivalents_for_accelerated_ranges \ | |
| tests.data.test_generated_data_oracle | |
| FROM python:3.15.2-slim-trixie | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gzip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY app.py . | |
| COPY backend/ backend/ | |
| COPY scripts/search_data_config.py scripts/start_search.sh /app/scripts/ | |
| COPY --from=search-index-build /native/ /app/ | |
| COPY --from=static-assets /out/ static/ | |
| # Ship one complete generation, after all source and independent index gates. | |
| COPY --from=search-index-verified /check/data/ /app/data/ | |
| EXPOSE 7860 | |
| CMD ["sh", "/app/scripts/start_search.sh"] | |