Update Dockerfile
Browse files- Dockerfile +94 -3
Dockerfile
CHANGED
|
@@ -1,3 +1,94 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM alpine:3.15
|
| 2 |
+
ENTRYPOINT ["/sbin/tini","--","/usr/local/searx/dockerfiles/docker-entrypoint.sh"]
|
| 3 |
+
EXPOSE 8080
|
| 4 |
+
VOLUME /etc/searx
|
| 5 |
+
VOLUME /var/log/uwsgi
|
| 6 |
+
|
| 7 |
+
ARG SEARX_GID=977
|
| 8 |
+
ARG SEARX_UID=977
|
| 9 |
+
|
| 10 |
+
RUN addgroup -g ${SEARX_GID} searx && \
|
| 11 |
+
adduser -u ${SEARX_UID} -D -h /usr/local/searx -s /bin/sh -G searx searx
|
| 12 |
+
|
| 13 |
+
ENV INSTANCE_NAME=searx \
|
| 14 |
+
AUTOCOMPLETE= \
|
| 15 |
+
BASE_URL= \
|
| 16 |
+
MORTY_KEY= \
|
| 17 |
+
MORTY_URL= \
|
| 18 |
+
SEARX_SETTINGS_PATH=/etc/searx/settings.yml \
|
| 19 |
+
UWSGI_SETTINGS_PATH=/etc/searx/uwsgi.ini
|
| 20 |
+
|
| 21 |
+
WORKDIR /usr/local/searx
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
COPY requirements.txt ./requirements.txt
|
| 25 |
+
|
| 26 |
+
RUN apk upgrade --no-cache \
|
| 27 |
+
&& apk add --no-cache -t build-dependencies \
|
| 28 |
+
build-base \
|
| 29 |
+
py3-setuptools \
|
| 30 |
+
python3-dev \
|
| 31 |
+
libffi-dev \
|
| 32 |
+
libxslt-dev \
|
| 33 |
+
libxml2-dev \
|
| 34 |
+
openssl-dev \
|
| 35 |
+
tar \
|
| 36 |
+
git \
|
| 37 |
+
&& apk add --no-cache \
|
| 38 |
+
ca-certificates \
|
| 39 |
+
su-exec \
|
| 40 |
+
python3 \
|
| 41 |
+
py3-pip \
|
| 42 |
+
libxml2 \
|
| 43 |
+
libxslt \
|
| 44 |
+
openssl \
|
| 45 |
+
tini \
|
| 46 |
+
uwsgi \
|
| 47 |
+
uwsgi-python3 \
|
| 48 |
+
brotli \
|
| 49 |
+
&& pip3 install --upgrade pip wheel setuptools \
|
| 50 |
+
&& pip3 install --no-cache -r requirements.txt \
|
| 51 |
+
&& apk del build-dependencies \
|
| 52 |
+
&& rm -rf /root/.cache
|
| 53 |
+
|
| 54 |
+
COPY searx ./searx
|
| 55 |
+
COPY dockerfiles ./dockerfiles
|
| 56 |
+
|
| 57 |
+
ARG TIMESTAMP_SETTINGS=0
|
| 58 |
+
ARG TIMESTAMP_UWSGI=0
|
| 59 |
+
ARG VERSION_GITCOMMIT=unknown
|
| 60 |
+
|
| 61 |
+
RUN /usr/bin/python3 -m compileall -q searx; \
|
| 62 |
+
touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml; \
|
| 63 |
+
touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini; \
|
| 64 |
+
if [ ! -z $VERSION_GITCOMMIT ]; then\
|
| 65 |
+
echo "VERSION_STRING = VERSION_STRING + \"-$VERSION_GITCOMMIT\"" >> /usr/local/searx/searx/version.py; \
|
| 66 |
+
fi; \
|
| 67 |
+
find /usr/local/searx/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \
|
| 68 |
+
-o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \
|
| 69 |
+
-type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
|
| 70 |
+
|
| 71 |
+
# Keep these arguments at the end to prevent redundant layer rebuilds
|
| 72 |
+
ARG LABEL_DATE=
|
| 73 |
+
ARG GIT_URL=unknown
|
| 74 |
+
ARG SEARX_GIT_VERSION=unknown
|
| 75 |
+
ARG LABEL_VCS_REF=
|
| 76 |
+
ARG LABEL_VCS_URL=
|
| 77 |
+
LABEL maintainer="searx <${GIT_URL}>" \
|
| 78 |
+
description="A privacy-respecting, hackable metasearch engine." \
|
| 79 |
+
version="${SEARX_GIT_VERSION}" \
|
| 80 |
+
org.label-schema.schema-version="1.0" \
|
| 81 |
+
org.label-schema.name="searx" \
|
| 82 |
+
org.label-schema.version="${SEARX_GIT_VERSION}" \
|
| 83 |
+
org.label-schema.url="${LABEL_VCS_URL}" \
|
| 84 |
+
org.label-schema.vcs-ref=${LABEL_VCS_REF} \
|
| 85 |
+
org.label-schema.vcs-url=${LABEL_VCS_URL} \
|
| 86 |
+
org.label-schema.build-date="${LABEL_DATE}" \
|
| 87 |
+
org.label-schema.usage="https://github.com/searx/searx-docker" \
|
| 88 |
+
org.opencontainers.image.title="searx" \
|
| 89 |
+
org.opencontainers.image.version="${SEARX_GIT_VERSION}" \
|
| 90 |
+
org.opencontainers.image.url="${LABEL_VCS_URL}" \
|
| 91 |
+
org.opencontainers.image.revision=${LABEL_VCS_REF} \
|
| 92 |
+
org.opencontainers.image.source=${LABEL_VCS_URL} \
|
| 93 |
+
org.opencontainers.image.created="${LABEL_DATE}" \
|
| 94 |
+
org.opencontainers.image.documentation="https://github.com/searx/searx-docker"
|