summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
author3nprob <3nprob@3nprob>2021-04-05 15:50:28 +0900
committer3nprob <3nprob@3nprob>2021-04-05 15:51:34 +0900
commit3c6c82733026fe737d7c767639a887bfab526d7e (patch)
treea7dcc268f924ff6edaa41202fc6296ebdc4b1253 /Dockerfile
parentba90c5a2e0629b0a04a090f11781782d15ca5dbe (diff)
Reduce redundant docker build steps
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile19
1 files changed, 9 insertions, 10 deletions
diff --git a/Dockerfile b/Dockerfile
index 3894aa96..d1a5632b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,21 +4,12 @@ EXPOSE 8080
VOLUME /etc/searx
VOLUME /var/log/uwsgi
-ARG GIT_URL=unknown
-ARG VERSION_GITCOMMIT=unknown
-ARG SEARX_GIT_VERSION=unknown
-
ARG SEARX_GID=977
ARG SEARX_UID=977
RUN addgroup -g ${SEARX_GID} searx && \
adduser -u ${SEARX_UID} -D -h /usr/local/searx -s /bin/sh -G searx searx
-ARG TIMESTAMP_SETTINGS=0
-ARG TIMESTAMP_UWSGI=0
-ARG LABEL_VCS_REF=
-ARG LABEL_VCS_URL=
-
ENV INSTANCE_NAME=searx \
AUTOCOMPLETE= \
BASE_URL= \
@@ -60,6 +51,10 @@ RUN apk upgrade --no-cache \
COPY --chown=searx:searx . .
+ARG TIMESTAMP_SETTINGS=0
+ARG TIMESTAMP_UWSGI=0
+ARG VERSION_GITCOMMIT=unknown
+
RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \
touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml; \
touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini; \
@@ -70,8 +65,12 @@ RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \
-o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \
-type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
-# Keep this argument at the end since it change each time
+# Keep these arguments at the end to prevent redundant layer rebuilds
ARG LABEL_DATE=
+ARG GIT_URL=unknown
+ARG SEARX_GIT_VERSION=unknown
+ARG LABEL_VCS_REF=
+ARG LABEL_VCS_URL=
LABEL maintainer="searx <${GIT_URL}>" \
description="A privacy-respecting, hackable metasearch engine." \
version="${SEARX_GIT_VERSION}" \