1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. FROM alpine:3.5
  2. MAINTAINER searx <https://github.com/asciimoo/searx>
  3. LABEL description "A privacy-respecting, hackable metasearch engine."
  4. ENV BASE_URL=False IMAGE_PROXY=False
  5. EXPOSE 8888
  6. WORKDIR /usr/local/searx
  7. CMD ["/sbin/tini","--","/usr/local/searx/run.sh"]
  8. RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx \
  9. && echo '#!/bin/sh' >> run.sh \
  10. && echo 'sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml' >> run.sh \
  11. && echo 'sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml' >> run.sh \
  12. && echo 'sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml' >> run.sh \
  13. && echo 'python searx/webapp.py' >> run.sh \
  14. && chmod +x run.sh
  15. COPY requirements.txt ./requirements.txt
  16. RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
  17. && apk -U add \
  18. build-base \
  19. python \
  20. python-dev \
  21. py-pip \
  22. libxml2 \
  23. libxml2-dev \
  24. libxslt \
  25. libxslt-dev \
  26. libffi-dev \
  27. openssl \
  28. openssl-dev \
  29. ca-certificates \
  30. tini@commuedge \
  31. && pip install --no-cache -r requirements.txt \
  32. && apk del \
  33. build-base \
  34. python-dev \
  35. libffi-dev \
  36. openssl-dev \
  37. libxslt-dev \
  38. libxml2-dev \
  39. openssl-dev \
  40. ca-certificates \
  41. && rm -f /var/cache/apk/*
  42. COPY . .
  43. RUN chown -R searx:searx *
  44. USER searx
  45. RUN sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml