From 184f24145f95e4c40488cdfbc03a545cd8d8cefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Wed, 13 Dec 2017 19:20:01 +0100 Subject: [PATCH] chore: initial image copy github.com/wonderfall/dockerfiles/searx, modify to fit my base image, add ci and update to newest version --- .drone.yml | 8 +++++++ .gitignore | 1 + Dockerfile | 38 ++++++++++++++++++++++++++++++++ README.md | 45 +++++++++++++++++++++++++++++++++++++- root/etc/s6.d/searx/crash | 2 ++ root/etc/s6.d/searx/finish | 2 ++ root/etc/s6.d/searx/run | 6 +++++ 7 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100755 root/etc/s6.d/searx/crash create mode 100755 root/etc/s6.d/searx/finish create mode 100755 root/etc/s6.d/searx/run diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..cf687a3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,8 @@ +pipeline: + docker: + image: plugins/docker + repo: docker.jcg.re/searx + registry: docker.jcg.re + secrets: [ docker_username, docker_password ] + tags: latest + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..78f4d9e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM docker.jcg.re/base-alpine +MAINTAINER Jan Christian Grünhage + +ARG SEARX_VERSION=0.13.1 + +ENV BASE_URL=False \ + IMAGE_PROXY=False \ + UID=192 \ + GID=192 + +RUN apk -U upgrade \ + && apk add -t build-dependencies \ + build-base \ + python-dev \ + libffi-dev \ + libxslt-dev \ + libxml2-dev \ + openssl-dev \ + tar \ + ca-certificates \ + && apk add \ + python \ + libxml2 \ + libxslt \ + openssl \ + py2-pip \ + && mkdir /usr/local/searx && cd /usr/local/searx \ + && wget -qO- https://github.com/asciimoo/searx/archive/v${SEARX_VERSION}.tar.gz | tar xz --strip 1 \ + && pip install --no-cache -r requirements.txt \ + && sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml \ + && apk del build-dependencies \ + && rm -f /var/cache/apk/* + +COPY root / + +EXPOSE 8888 + +VOLUME /usr/local/searx/searx/setting.yml diff --git a/README.md b/README.md index ec317ae..1bcd577 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,45 @@ -# docker-searx +## docker-searx +#### What is searx? +Searx is a metasearch engine, inspired by the seeks project. +It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrom[e|ium]). Therefore they show up in neither our logs, nor your url history. In case of Chrom[e|ium] users there is an exception, Searx uses the search bar to perform GET requests. Searx can be added to your browser's search bar; moreover, it can be set as the default search engine. + +#### Features +- Based on Alpine Linux. +- Latest code from [asciimoo/searx](https://github.com/asciimoo/searx) +- A unique secret key is generated when booting the first time. + +### Credits +First of all, thanks to [wonderfall](https://github.com/Wonderfall) for his Dockerfile collection. A lot of this image is based on his image, and was only created because wonderfall discontinued maintainership of all his images. + +### Get the image +You can either build the docker image yourself: +```bash +docker build -t docker.jcg.re/searx https://git.jcg.re/jcgruenhage/docker-searx.git +``` + +or pull a prebuilt image from my docker registry: + +```bash +docker pull docker.jcg.re/searx +``` +### Run the container +Insecure local instance: + +```bash +docker run \ + --rm \ + --publish 80:8888 \ + --env BASE_URL=http://localhost \ + docker.jcg.re/searx +``` + +#### Build-time variables +- **VERSION** : Searx version + +#### Environment variables +- **IMAGE_PROXY** : enables images proxying *(default : False)* +- **BASE_URL** : http://domain.tld *(default : False)* + +#### Ports +- **8888** (non-tls, so use a reverse proxy) diff --git a/root/etc/s6.d/searx/crash b/root/etc/s6.d/searx/crash new file mode 100755 index 0000000..22665fa --- /dev/null +++ b/root/etc/s6.d/searx/crash @@ -0,0 +1,2 @@ +#!/bin/sh +exec /bin/true diff --git a/root/etc/s6.d/searx/finish b/root/etc/s6.d/searx/finish new file mode 100755 index 0000000..22665fa --- /dev/null +++ b/root/etc/s6.d/searx/finish @@ -0,0 +1,2 @@ +#!/bin/sh +exec /bin/true diff --git a/root/etc/s6.d/searx/run b/root/etc/s6.d/searx/run new file mode 100755 index 0000000..76a8b32 --- /dev/null +++ b/root/etc/s6.d/searx/run @@ -0,0 +1,6 @@ +#!/bin/sh +sed -i -e "s|base_url : False|base_url : ${BASE_URL}|g" \ + -e "s/image_proxy : False/image_proxy : ${IMAGE_PROXY}/g" \ + -e "s/ultrasecretkey/$(openssl rand -hex 16)/g" \ + /usr/local/searx/searx/settings.yml +su-exec ${UID}:${GID} python /usr/local/searx/searx/webapp.py