ARG ARCH FROM alpine:3.14.2@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412c2fa221cf1a824e6a AS base-amd64 FROM arm32v7/alpine:3.14.2@sha256:e12ff876f0075740ed3d7bdf788107ae84c1b3dd6dc98b3baea41088aba5236f AS base-arm FROM arm64v8/alpine:3.14.2@sha256:b06a5cf61b2956088722c4f1b9a6f71dfe95f0b1fe285d44195452b8a1627de7 AS base-arm64 FROM base-${ARCH} RUN addgroup searx && adduser -D -h /usr/local/searx -s /bin/sh -G searx searx ENV SEARX_VERSION="1.0.0" ENV INSTANCE_NAME=searx WORKDIR /usr/local/searx RUN apk upgrade --no-cache \ && apk add --no-cache -t build-dependencies \ gcc="10.3.1_git20210424-r2" \ musl-dev="1.2.2-r3" \ cargo="1.52.1-r1" \ build-base="0.5-r2" \ py3-setuptools="52.0.0-r3" \ python3-dev="3.9.5-r1" \ libffi-dev="3.3-r2" \ libxslt-dev="1.1.34-r1" \ libxml2-dev="2.9.12-r1" \ openssl-dev="1.1.1l-r0" \ tar="1.34-r0" \ git="2.32.0-r0" \ curl="7.79.1-r0" \ && apk add --no-cache \ ca-certificates="20191127-r5" \ su-exec="0.2-r1" \ python3="3.9.5-r1" \ py3-pip="20.3.4-r1" \ libxml2="2.9.12-r1" \ libxslt="1.1.34-r1" \ openssl="1.1.1l-r0" \ tini="0.19.0-r0" \ uwsgi="2.0.19.1-r2" \ uwsgi-python3="2.0.19.1-r2" \ brotli="1.0.9-r5" \ && curl -L "https://github.com/searx/searx/archive/${SEARX_VERSION}.tar.gz" | tar xvz --strip 1 && chown -R searx:searx * \ && pip3 install --upgrade pip \ && pip3 install --no-cache -r requirements.txt \ && apk del build-dependencies \ && rm -rf /root/.cache RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \ touch -c searx/settings.yml; \ touch -c dockerfiles/uwsgi.ini; \ find /usr/local/searx/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 {} \+ EXPOSE 8080 ENTRYPOINT ["/sbin/tini","--","/usr/local/searx/dockerfiles/docker-entrypoint.sh"]