summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2022-11-30 09:16:14 +0100
committerGitHub <noreply@github.com>2022-11-30 09:16:14 +0100
commitf19837cfade443b460deb24af94573a966b009a6 (patch)
tree9f195dbe3038374284e61bb331f07ca4604ed37b /Dockerfile
parent768659f2bdd1fbd376d809c2a727a4ea0768b973 (diff)
parent6b88e857f9df5df6b0f35af618b651271363c2a2 (diff)
downloadsearxng-f19837cfade443b460deb24af94573a966b009a6.tar.gz
searxng-f19837cfade443b460deb24af94573a966b009a6.zip
Merge pull request #1896 from ngosang/feature/size
Reduce Docker image size
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile15
1 files changed, 7 insertions, 8 deletions
diff --git a/Dockerfile b/Dockerfile
index 64aa8bcef..79602553d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -22,8 +22,7 @@ WORKDIR /usr/local/searxng
COPY requirements.txt ./requirements.txt
-RUN apk upgrade --no-cache \
- && apk add --no-cache -t build-dependencies \
+RUN apk add --no-cache -t build-dependencies \
build-base \
py3-setuptools \
python3-dev \
@@ -45,21 +44,21 @@ RUN apk upgrade --no-cache \
uwsgi \
uwsgi-python3 \
brotli \
- && pip3 install --upgrade pip wheel setuptools \
&& pip3 install --no-cache -r requirements.txt \
&& apk del build-dependencies \
&& rm -rf /root/.cache
-COPY --chown=searxng:searxng . .
+COPY --chown=searxng:searxng dockerfiles ./dockerfiles
+COPY --chown=searxng:searxng searx ./searx
ARG TIMESTAMP_SETTINGS=0
ARG TIMESTAMP_UWSGI=0
ARG VERSION_GITCOMMIT=unknown
-RUN su searxng -c "/usr/bin/python3 -m compileall -q searx"; \
- touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml; \
- touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini; \
- find /usr/local/searxng/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \
+RUN su searxng -c "/usr/bin/python3 -m compileall -q searx" \
+ && touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml \
+ && touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini \
+ && find /usr/local/searxng/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \
-o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \
-type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+