Commit d27ed7ff authored by Gaël Duval's avatar Gaël Duval 🏄🏼
Browse files

Merge branch 'nicofonk/docker-compose' into 'master'

introduce docker-compose to run spot in a dedicated env

See merge request e/cloud/my-spot!18
parents 2303d070 31f7f219
......@@ -2,23 +2,15 @@ FROM alpine:3.8
LABEL maintainer="searx <https://github.com/asciimoo/searx>"
LABEL description="A privacy-respecting, hackable metasearch engine."
ENV BASE_URL=False IMAGE_PROXY=False
EXPOSE 8888
WORKDIR /usr/local/searx
CMD ["/sbin/tini","--","/usr/local/searx/run.sh"]
CMD ["python", "searx/webapp.py"]
RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx \
&& echo '#!/bin/sh' >> run.sh \
&& echo 'sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml' >> run.sh \
&& echo 'sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml' >> run.sh \
&& echo 'sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml' >> run.sh \
&& echo 'python searx/webapp.py' >> run.sh \
&& chmod +x run.sh
RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx
COPY requirements.txt ./requirements.txt
RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk -U add \
RUN apk -U add \
build-base \
python \
python-dev \
......@@ -31,7 +23,6 @@ RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/ap
openssl \
openssl-dev \
ca-certificates \
tini@commuedge \
&& pip install --upgrade pip \
&& pip install --no-cache -r requirements.txt \
&& apk del \
......@@ -52,3 +43,5 @@ RUN chown -R searx:searx *
USER searx
RUN sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml
STOPSIGNAL SIGINT
......@@ -9,25 +9,22 @@ Spot was forked from searx: read `documentation <https://asciimoo.github.io/sear
|OpenCollective searx backers|
|OpenCollective searx sponsors|
Setup Redis
~~~~~~~~~~~
**Install Redis**
``$ sudo apt-get install redis-server
$ pip install redis``
Installation
Getting Started
~~~~~~~~~~~~
- clone source:
``git clone https://gitlab.e.foundation/spot/my-spot.git && cd my-spot``
- install dependencies: ``./manage.sh update_packages``
- edit your
`settings.yml <https://github.com/asciimoo/searx/blob/master/searx/settings.yml>`__
(set your ``secret_key``!)
- run ``python searx/webapp.py`` to start the application
You can run spot with docker-compose to run the **redis** database and
the **spot** service. First of all you have to install **docker** and
**docker-compose** on your host, then follow instructions below to run spot
with one command.
- Run the docker-compose **up** command to start the project ``docker-compose up --build``
- Getting the ip of the spot service and go to http://<spot-ip>:8888
.. note:: Here the command to get the IP of the spot service
``docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' my-spot_spot_1``
For all the details, follow this `step by step
You can also install **redis** and **spot** on your host, for all the details, follow this `step by step
installation <https://github.com/asciimoo/searx/wiki/Installation>`__.
Bugs
......
version: '3.6'
services:
redis:
image: redis:5-alpine
spot:
build: .
environment:
SEARX_REDIS_HOST: redis
......@@ -91,3 +91,9 @@ logger.info('Initialisation done')
if 'SEARX_SECRET' in environ:
settings['server']['secret_key'] = environ['SEARX_SECRET']
if 'BASE_URL' in environ:
settings['server']['base_url'] = environ['BASE_URL']
if 'IMAGE_PROXY' in environ:
settings['server']['image_proxy'] = environ['IMAGE_PROXY']
if 'SEARX_REDIS_HOST' in environ:
settings['redis']['host'] = environ['SEARX_REDIS_HOST']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment