2018-08-19 12:17:11 +00:00
|
|
|
FROM alpine:3.8
|
2018-03-10 14:58:13 +00:00
|
|
|
LABEL maintainer="searx <https://github.com/asciimoo/searx>"
|
|
|
|
LABEL description="A privacy-respecting, hackable metasearch engine."
|
2015-06-10 08:50:00 +00:00
|
|
|
|
2019-01-14 08:24:57 +00:00
|
|
|
ENV BASE_URL=False IMAGE_PROXY=False HTTP_PROXY_URL= HTTPS_PROXY_URL=
|
2016-01-03 14:17:59 +00:00
|
|
|
EXPOSE 8888
|
|
|
|
WORKDIR /usr/local/searx
|
2017-02-08 22:37:52 +00:00
|
|
|
CMD ["/sbin/tini","--","/usr/local/searx/run.sh"]
|
2016-01-03 14:17:59 +00:00
|
|
|
|
2016-01-03 14:45:13 +00:00
|
|
|
RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx \
|
|
|
|
&& echo '#!/bin/sh' >> run.sh \
|
|
|
|
&& echo 'sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml' >> run.sh \
|
2016-01-15 20:57:34 +00:00
|
|
|
&& echo 'sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml' >> run.sh \
|
2016-01-04 06:38:47 +00:00
|
|
|
&& echo 'sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml' >> run.sh \
|
2019-01-12 10:06:44 +00:00
|
|
|
&& echo 'if [ -n "$HTTP_PROXY_URL" ] || [ -n "$HTTPS_PROXY_URL" ]; then' >> run.sh \
|
|
|
|
&& echo ' sed -i "s~^# proxies :~ proxies:\\n http: ${HTTP_PROXY_URL}\\n https: ${HTTPS_PROXY_URL}\\n~" searx/settings.yml' >> run.sh \
|
|
|
|
&& echo 'fi' >> run.sh \
|
2016-01-03 14:45:13 +00:00
|
|
|
&& echo 'python searx/webapp.py' >> run.sh \
|
|
|
|
&& chmod +x run.sh
|
|
|
|
|
2016-01-15 20:57:34 +00:00
|
|
|
COPY requirements.txt ./requirements.txt
|
2015-06-10 08:50:00 +00:00
|
|
|
|
2016-02-09 20:02:40 +00:00
|
|
|
RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
|
|
|
&& apk -U add \
|
2015-12-30 10:23:45 +00:00
|
|
|
build-base \
|
|
|
|
python \
|
|
|
|
python-dev \
|
|
|
|
py-pip \
|
|
|
|
libxml2 \
|
|
|
|
libxml2-dev \
|
|
|
|
libxslt \
|
|
|
|
libxslt-dev \
|
|
|
|
libffi-dev \
|
|
|
|
openssl \
|
|
|
|
openssl-dev \
|
|
|
|
ca-certificates \
|
2016-02-09 20:02:40 +00:00
|
|
|
tini@commuedge \
|
2018-11-29 17:49:03 +00:00
|
|
|
&& pip install --upgrade pip \
|
2016-01-04 11:52:59 +00:00
|
|
|
&& pip install --no-cache -r requirements.txt \
|
2015-12-30 10:23:45 +00:00
|
|
|
&& apk del \
|
|
|
|
build-base \
|
|
|
|
python-dev \
|
|
|
|
libffi-dev \
|
|
|
|
openssl-dev \
|
|
|
|
libxslt-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
openssl-dev \
|
|
|
|
ca-certificates \
|
|
|
|
&& rm -f /var/cache/apk/*
|
2015-01-27 22:14:05 +00:00
|
|
|
|
2016-01-04 11:52:59 +00:00
|
|
|
COPY . .
|
2016-01-03 14:17:59 +00:00
|
|
|
|
2016-01-04 11:52:59 +00:00
|
|
|
RUN chown -R searx:searx *
|
2016-01-03 14:17:59 +00:00
|
|
|
|
2015-12-30 10:23:45 +00:00
|
|
|
USER searx
|
2016-01-03 14:17:59 +00:00
|
|
|
|
2016-01-04 06:38:47 +00:00
|
|
|
RUN sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml
|