mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
a006498843
commit
f60e82fcb8
2 changed files with 37 additions and 14 deletions
49
Dockerfile
49
Dockerfile
|
@ -1,12 +1,13 @@
|
||||||
FROM python:3.11-slim-bullseye as builder
|
FROM python:3.11-alpine3.17
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini","--","/usr/local/searxng/dockerfiles/docker-entrypoint.sh"]
|
ENTRYPOINT ["/sbin/tini","--","/usr/local/searxng/dockerfiles/docker-entrypoint.sh"]
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
VOLUME /etc/searxng
|
VOLUME /etc/searxng
|
||||||
|
|
||||||
RUN addgroup --gid 977 searxng && \
|
ARG SEARXNG_GID=977
|
||||||
mkdir -p /usr/local/searxng && \
|
ARG SEARXNG_UID=977
|
||||||
adduser -uid 977 --disabled-password --home /usr/local/searxng --shell /bin/sh --ingroup searxng searxng
|
|
||||||
|
RUN addgroup -g ${SEARXNG_GID} searxng && \
|
||||||
|
adduser -u ${SEARXNG_UID} -D -h /usr/local/searxng -s /bin/sh -G searxng searxng
|
||||||
|
|
||||||
ENV INSTANCE_NAME=searxng \
|
ENV INSTANCE_NAME=searxng \
|
||||||
AUTOCOMPLETE= \
|
AUTOCOMPLETE= \
|
||||||
|
@ -16,14 +17,36 @@ ENV INSTANCE_NAME=searxng \
|
||||||
GPTKEY= \
|
GPTKEY= \
|
||||||
GPTORG= \
|
GPTORG= \
|
||||||
SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml \
|
SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml \
|
||||||
UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini \
|
UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini
|
||||||
PATH="/root/.cargo/bin:${PATH}"
|
|
||||||
|
|
||||||
WORKDIR /usr/local/searxng
|
WORKDIR /usr/local/searxng
|
||||||
|
|
||||||
COPY requirements.txt ./requirements.txt
|
COPY requirements.txt ./requirements.txt
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y git gcc curl && curl https://sh.rustup.rs -sSf | sh -s -- -y && apt-get install --reinstall libc6-dev -y && pip3 install --no-cache -r requirements.txt \
|
RUN apk add --no-cache -t build-dependencies \
|
||||||
|
build-base \
|
||||||
|
py3-setuptools \
|
||||||
|
python3-dev \
|
||||||
|
libffi-dev \
|
||||||
|
libxslt-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
openssl-dev \
|
||||||
|
tar \
|
||||||
|
git \
|
||||||
|
&& apk add --no-cache \
|
||||||
|
ca-certificates \
|
||||||
|
su-exec \
|
||||||
|
python3 \
|
||||||
|
py3-pip \
|
||||||
|
libxml2 \
|
||||||
|
libxslt \
|
||||||
|
openssl \
|
||||||
|
tini \
|
||||||
|
uwsgi \
|
||||||
|
uwsgi-python3 \
|
||||||
|
brotli \
|
||||||
|
&& pip3 install --no-cache -r requirements.txt \
|
||||||
|
&& apk del build-dependencies \
|
||||||
&& rm -rf /root/.cache
|
&& rm -rf /root/.cache
|
||||||
|
|
||||||
COPY --chown=searxng:searxng dockerfiles ./dockerfiles
|
COPY --chown=searxng:searxng dockerfiles ./dockerfiles
|
||||||
|
@ -33,12 +56,12 @@ ARG TIMESTAMP_SETTINGS=0
|
||||||
ARG TIMESTAMP_UWSGI=0
|
ARG TIMESTAMP_UWSGI=0
|
||||||
ARG VERSION_GITCOMMIT=unknown
|
ARG VERSION_GITCOMMIT=unknown
|
||||||
|
|
||||||
RUN su searxng -c "/usr/local/bin/python -m compileall -q searx" \
|
RUN su searxng -c "/usr/bin/python3 -m compileall -q searx" \
|
||||||
&& touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml \
|
&& touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml \
|
||||||
&& touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini
|
&& touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini \
|
||||||
# && find /usr/local/searxng/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \
|
&& find /usr/local/searxng/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \
|
||||||
# -o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \
|
-o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \
|
||||||
# -type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
|
-type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
|
||||||
|
|
||||||
# Keep these arguments at the end to prevent redundant layer rebuilds
|
# Keep these arguments at the end to prevent redundant layer rebuilds
|
||||||
ARG LABEL_DATE=
|
ARG LABEL_DATE=
|
||||||
|
|
|
@ -175,4 +175,4 @@ unset MORTY_KEY
|
||||||
|
|
||||||
# Start uwsgi
|
# Start uwsgi
|
||||||
printf 'Listen on %s\n' "${BIND_ADDRESS}"
|
printf 'Listen on %s\n' "${BIND_ADDRESS}"
|
||||||
exec su www-data -c "uwsgi --master --http-socket 0.0.0.0:8080 /etc/searxng/uwsgi.ini"
|
exec su-exec searxng:searxng uwsgi --master --http-socket "${BIND_ADDRESS}" "${UWSGI_SETTINGS_PATH}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue