Dockerfile 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. FROM alpine:3.3
  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 ["/usr/bin/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. py-pip\
  36. libffi-dev \
  37. openssl-dev \
  38. libxslt-dev \
  39. libxml2-dev \
  40. openssl-dev \
  41. ca-certificates \
  42. && rm -f /var/cache/apk/*
  43. COPY . .
  44. RUN chown -R searx:searx *
  45. USER searx
  46. RUN sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml