mirror of
https://github.com/searxng/searxng.git
synced 2026-09-14 18:26:04 +00:00
Free from ghcr.io/searxng/cache! Now we save and load images without polluting this shared (and useless) layer cache, which also makes it easy to download artifacts for local debugging. I also removed this nonsense about virtualenv normalization, this will be properly fixed by using lockfiles on py dependencies.
26 lines
1.0 KiB
Docker
26 lines
1.0 KiB
Docker
FROM docker.io/searxng/base:searxng-builder AS builder
|
|
|
|
COPY ./requirements.txt ./requirements-server.txt ./
|
|
|
|
ENV UV_NO_MANAGED_PYTHON="true"
|
|
|
|
RUN --mount=type=cache,id=uv,target=/root/.cache/uv set -eux -o pipefail; \
|
|
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/
|
|
|
|
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 +
|