mirror of https://github.com/searxng/searxng.git
Better Docker embedded support
This commit is contained in:
parent
01f3e41fec
commit
2dc067f026
58
Dockerfile
58
Dockerfile
|
@ -1,22 +1,44 @@
|
||||||
FROM python:2.7-slim
|
FROM alpine:3.3
|
||||||
|
MAINTAINER Wonderfall <wonderfall@opmbx.org>
|
||||||
|
|
||||||
WORKDIR /app
|
ENV BASE_URL=False IMAGE_PROXY=False
|
||||||
|
|
||||||
RUN useradd searx
|
COPY . /usr/local/searx
|
||||||
|
|
||||||
EXPOSE 5000
|
RUN apk -U add \
|
||||||
CMD ["/usr/local/bin/uwsgi", "--uid", "searx", "--gid", "searx", "--http", ":5000", "-w", "searx.webapp"]
|
build-base \
|
||||||
|
python \
|
||||||
|
python-dev \
|
||||||
|
py-pip \
|
||||||
|
libxml2 \
|
||||||
|
libxml2-dev \
|
||||||
|
libxslt \
|
||||||
|
libxslt-dev \
|
||||||
|
libffi-dev \
|
||||||
|
openssl \
|
||||||
|
openssl-dev \
|
||||||
|
ca-certificates \
|
||||||
|
&& adduser -D -h /usr/local/searx -s /bin/sh searx searx \
|
||||||
|
&& cd /usr/local/searx \
|
||||||
|
&& pip install --no-cache -r requirements.txt \
|
||||||
|
&& sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml \
|
||||||
|
&& sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml \
|
||||||
|
&& sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml \
|
||||||
|
&& sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml \
|
||||||
|
&& apk del \
|
||||||
|
build-base \
|
||||||
|
python-dev \
|
||||||
|
py-pip\
|
||||||
|
libffi-dev \
|
||||||
|
openssl-dev \
|
||||||
|
libxslt-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
openssl-dev \
|
||||||
|
ca-certificates \
|
||||||
|
&& chown -R searx:searx /usr/local/searx \
|
||||||
|
&& rm -f /var/cache/apk/*
|
||||||
|
|
||||||
RUN apt-get update && \
|
EXPOSE 8888
|
||||||
apt-get install -y --no-install-recommends \
|
USER searx
|
||||||
zlib1g-dev libxml2-dev libxslt1-dev libffi-dev build-essential \
|
WORKDIR /usr/local/searx
|
||||||
libssl-dev openssl && \
|
CMD ["python", "searx/webapp.py"]
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN pip install --no-cache uwsgi
|
|
||||||
|
|
||||||
COPY requirements.txt /app/requirements.txt
|
|
||||||
RUN pip install --no-cache -r requirements.txt
|
|
||||||
|
|
||||||
COPY . /app
|
|
||||||
RUN sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml
|
|
||||||
|
|
Loading…
Reference in New Issue