mirror of
https://github.com/searxng/searxng.git
synced 2026-09-14 18:26:04 +00:00
[mod] container: rework builds (#6720)
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.
This commit is contained in:
@@ -3,21 +3,15 @@ FROM docker.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" {} +
|
||||
python -m compileall -q -f -j 0 --invalidation-mode=unchecked-hash ./.venv/lib/
|
||||
|
||||
COPY --exclude=./searx/version_frozen.py ./searx/ ./searx/
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
ARG CONTAINER_IMAGE_ORGANIZATION="searxng"
|
||||
ARG CONTAINER_IMAGE_NAME="searxng"
|
||||
|
||||
FROM localhost/$CONTAINER_IMAGE_ORGANIZATION/$CONTAINER_IMAGE_NAME:builder AS builder
|
||||
FROM localhost/searxng/searxng:builder AS builder
|
||||
FROM docker.io/searxng/base:searxng AS dist
|
||||
|
||||
COPY --chown=977:977 --from=builder /usr/local/searxng/.venv/ ./.venv/
|
||||
|
||||
Reference in New Issue
Block a user