42 lines
1.7 KiB
Docker
42 lines
1.7 KiB
Docker
FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea
|
|
|
|
ARG VERSION=1.0.0
|
|
RUN mkdir -p /app/code /app/pkg
|
|
WORKDIR /app/code
|
|
|
|
# download the source code
|
|
RUN curl -L https://git.caric.io/mirrors/searxng/archive/m${VERSION}.tar.gz | tar -xz --strip-components 1 -f -
|
|
|
|
# install dependencies, including app dependencies from `requirements.txt`
|
|
RUN apt update && \
|
|
apt install -y python3 build-essential libxslt-dev python3-dev python3-virtualenv python3-setuptools zlib1g-dev libffi-dev libssl-dev python3-pip git tar ca-certificates libxml2 libxslt1-dev brotli && \
|
|
rm -rf /var/cache/apt /var/lib/apt/lists && \
|
|
pip3 install --upgrade pip wheel setuptools uwsgi && \
|
|
pip3 install --no-cache -r /app/code/requirements.txt
|
|
|
|
# compile code and compress static files
|
|
RUN /usr/bin/python3 -m compileall -q searx
|
|
# RUN find /app/code/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' -o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) -type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
|
|
|
|
ENV INSTANCE_NAME=searxng \
|
|
AUTOCOMPLETE= \
|
|
BASE_URL= \
|
|
MORTY_KEY= \
|
|
MORTY_URL= \
|
|
SEARXNG_SETTINGS_PATH=/app/data/settings.yml \
|
|
UWSGI_SETTINGS_PATH=/app/data/uwsgi.ini
|
|
|
|
RUN mv /app/code/searx/settings.yml /app/code/searx/settings.yml.orig && \
|
|
ln -sf /app/data/settings.yml /app/code/searx/settings.yml
|
|
|
|
RUN echo "VERSION_STRING=\"m${VERSION}\";VERSION_TAG=\"m${VERSION}\";GIT_URL=\"https://git.caric.io/mirrors/searxng\";GIT_BRANCH=\"m${VERSION}\"" \
|
|
> /app/code/searx/version_frozen.py
|
|
|
|
RUN chown -R www-data.www-data /app/code
|
|
|
|
# Fix python UnicodeDecodeError
|
|
ENV LANG C.UTF-8
|
|
|
|
COPY start.sh /app/pkg/start.sh
|
|
|
|
CMD [ "/app/pkg/start.sh" ]
|