Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. FROM alpine:3.3
  2. ENV BASE_URL=False IMAGE_PROXY=False
  3. EXPOSE 8888
  4. WORKDIR /usr/local/searx
  5. CMD ["./run.sh"]
  6. RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx \
  7. && echo '#!/bin/sh' >> run.sh \
  8. && echo 'sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml' >> run.sh \
  9. && echo 'sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml' >> run.sh \
  10. && echo 'sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml' >> run.sh \
  11. && echo 'python searx/webapp.py' >> run.sh \
  12. && chmod +x run.sh
  13. COPY requirements.txt ./requirements.txt
  14. RUN apk -U add \
  15. build-base \
  16. python \
  17. python-dev \
  18. py-pip \
  19. libxml2 \
  20. libxml2-dev \
  21. libxslt \
  22. libxslt-dev \
  23. libffi-dev \
  24. openssl \
  25. openssl-dev \
  26. ca-certificates \
  27. && pip install --no-cache -r requirements.txt \
  28. && apk del \
  29. build-base \
  30. python-dev \
  31. py-pip\
  32. libffi-dev \
  33. openssl-dev \
  34. libxslt-dev \
  35. libxml2-dev \
  36. openssl-dev \
  37. ca-certificates \
  38. && rm -f /var/cache/apk/*
  39. COPY . .
  40. RUN chown -R searx:searx *
  41. USER searx
  42. RUN sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml