Files
searxng/container/builder.dockerfile
Ivan Gabaldon 502c820a25 [fix] container: setup minimal (#6268)
Start minimal, use defaults, and extend later on. The templates are no longer
checked for changes, which was confusing and annoying after a while.

See: https://github.com/searxng/searxng/issues/6261#issuecomment-4716008282
2026-06-16 15:32:47 +02:00

32 lines
1.3 KiB
Docker

FROM ghcr.io/searxng/base:searxng-builder AS builder
COPY ./requirements.txt ./requirements-server.txt ./
ENV UV_NO_MANAGED_PYTHON="true"
ENV UV_NATIVE_TLS="true"
ARG TIMESTAMP_VENV="0"
RUN --mount=type=cache,id=uv,target=/root/.cache/uv set -eux -o pipefail; \
export SOURCE_DATE_EPOCH="$TIMESTAMP_VENV"; \
uv venv; \
uv pip install --requirements ./requirements.txt --requirements ./requirements-server.txt; \
uv cache prune --ci; \
find ./.venv/lib/ -type f -exec strip --strip-unneeded {} + || true; \
find ./.venv/lib/ -type d -name "__pycache__" -exec rm -rf {} +; \
find ./.venv/lib/ -type f -name "*.pyc" -delete; \
python -m compileall -q -f -j 0 --invalidation-mode=unchecked-hash ./.venv/lib/; \
find ./.venv/lib/python*/site-packages/*.dist-info/ -type f -name "RECORD" -exec sort -t, -k1,1 -o {} {} \;; \
find ./.venv/ -exec touch -h --date="@$TIMESTAMP_VENV" {} +
COPY --exclude=./searx/version_frozen.py ./searx/ ./searx/
RUN set -eux -o pipefail; \
python -m compileall -q -f -j 0 --invalidation-mode=unchecked-hash ./searx/; \
find ./searx/static/ -type f \
\( -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.svg" \) \
-exec gzip -9 -k {} + \
-exec brotli -9 -k {} + \
-exec gzip --test {}.gz + \
-exec brotli --test {}.br +