Files
searxng/container/builder.dockerfile
T

36 lines
1.4 KiB
Docker
Raw Normal View History

2025-08-07 10:46:26 +02:00
FROM ghcr.io/searxng/base:searxng-builder AS builder
COPY ./requirements.txt ./requirements-server.txt ./
2025-09-14 10:36:21 +02:00
2025-09-23 09:50:42 +02:00
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"; \
2025-09-14 10:36:21 +02:00
uv venv; \
2025-09-23 09:50:42 +02:00
uv pip install --requirements ./requirements.txt --requirements ./requirements-server.txt; \
2025-09-14 10:36:21 +02:00
uv cache prune --ci; \
2025-09-23 09:50:42 +02:00
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 {} {} \;; \
2025-09-23 09:50:42 +02:00
find ./.venv/ -exec touch -h --date="@$TIMESTAMP_VENV" {} +
2025-08-07 10:46:26 +02:00
# use "--exclude=./searx/version_frozen.py" when actions/runner-images updates to Podman 5.0+
2025-08-07 10:46:26 +02:00
COPY ./searx/ ./searx/
ARG TIMESTAMP_SETTINGS="0"
RUN set -eux -o pipefail; \
2025-09-23 09:50:42 +02:00
python -m compileall -q -f -j 0 --invalidation-mode=unchecked-hash ./searx/; \
2025-08-07 10:46:26 +02:00
find ./searx/static/ -type f \
2025-09-14 10:36:21 +02:00
\( -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 +; \
touch -c --date="@$TIMESTAMP_SETTINGS" ./searx/settings.yml