This repository has been archived on 2022-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
searx/Dockerfile

29 lines
1.2 KiB
Docker

FROM alpine:3.15.2@sha256:ceeae2849a425ef1a7e591d8288f1a58cdf1f4e8d9da7510e29ea829e61cf512
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 musl-dev cargo build-base py3-setuptools python3-dev libffi-dev libxslt-dev libxml2-dev openssl-dev tar git curl \
&& apk add --no-cache ca-certificates su-exec python3 py3-pip libxml2 libxslt openssl tini uwsgi uwsgi-python3 brotli \
&& 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"]