Dockerfile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. FROM alpine:3.10
  2. ENTRYPOINT ["/sbin/tini","--","/usr/local/searx/dockerfiles/docker-entrypoint.sh"]
  3. EXPOSE 8080
  4. VOLUME /etc/searx
  5. VOLUME /var/log/uwsgi
  6. ARG GIT_URL=unknown
  7. ARG VERSION_GITCOMMIT=unknown
  8. ARG SEARX_GIT_VERSION=unknown
  9. ARG SEARX_GID=977
  10. ARG SEARX_UID=977
  11. RUN addgroup -g ${SEARX_GID} searx && \
  12. adduser -u ${SEARX_UID} -D -h /usr/local/searx -s /bin/sh -G searx searx
  13. ARG TIMESTAMP_SETTINGS=0
  14. ARG TIMESTAMP_UWSGI=0
  15. ARG LABEL_VCS_REF=
  16. ARG LABEL_VCS_URL=
  17. ENV INSTANCE_NAME=searx \
  18. AUTOCOMPLETE= \
  19. BASE_URL= \
  20. MORTY_KEY= \
  21. MORTY_URL=
  22. WORKDIR /usr/local/searx
  23. COPY requirements.txt ./requirements.txt
  24. RUN apk upgrade --no-cache \
  25. && apk add --no-cache -t build-dependencies \
  26. build-base \
  27. py3-setuptools \
  28. python3-dev \
  29. libffi-dev \
  30. libxslt-dev \
  31. libxml2-dev \
  32. openssl-dev \
  33. tar \
  34. git \
  35. && apk add --no-cache \
  36. ca-certificates \
  37. su-exec \
  38. python3 \
  39. libxml2 \
  40. libxslt \
  41. openssl \
  42. tini \
  43. uwsgi \
  44. uwsgi-python3 \
  45. && pip3 install --upgrade pip \
  46. && pip3 install --no-cache -r requirements.txt \
  47. && apk del build-dependencies \
  48. && rm -rf /root/.cache
  49. COPY --chown=searx:searx . .
  50. RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \
  51. touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml; \
  52. touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini; \
  53. if [ ! -z $VERSION_GITCOMMIT ]; then\
  54. echo "VERSION_STRING = VERSION_STRING + \"-$VERSION_GITCOMMIT\"" >> /usr/local/searx/searx/version.py; \
  55. fi
  56. # Keep this argument at the end since it change each time
  57. ARG LABEL_DATE=
  58. LABEL maintainer="searx <${GIT_URL}>" \
  59. description="A privacy-respecting, hackable metasearch engine." \
  60. version="${SEARX_GIT_VERSION}" \
  61. org.label-schema.schema-version="1.0" \
  62. org.label-schema.name="searx" \
  63. org.label-schema.version="${SEARX_GIT_VERSION}" \
  64. org.label-schema.url="${LABEL_VCS_URL}" \
  65. org.label-schema.vcs-ref=${LABEL_VCS_REF} \
  66. org.label-schema.vcs-url=${LABEL_VCS_URL} \
  67. org.label-schema.build-date="${LABEL_DATE}" \
  68. org.label-schema.usage="https://github.com/searx/searx-docker" \
  69. org.opencontainers.image.title="searx" \
  70. org.opencontainers.image.version="${SEARX_GIT_VERSION}" \
  71. org.opencontainers.image.url="${LABEL_VCS_URL}" \
  72. org.opencontainers.image.revision=${LABEL_VCS_REF} \
  73. org.opencontainers.image.source=${LABEL_VCS_URL} \
  74. org.opencontainers.image.created="${LABEL_DATE}" \
  75. org.opencontainers.image.documentation="https://github.com/searx/searx-docker"