From 277ad86fb8f685c08caa3016f7d2cc9ae8f17dbe Mon Sep 17 00:00:00 2001 From: macbre Date: Tue, 25 Dec 2018 11:15:51 +0100 Subject: [PATCH 1/2] README: add a usage example --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 88d1b26..bd1f118 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,22 @@ Docker image for Sphinx search engine docker pull macbre/sphinxsearch ``` +## Usage example + +You can use this image in `docker-compose`-powered app: + +```yaml +services: + sphinx: + image: macbre/sphinxsearch:3.0.1 + ports: + - "127.0.0.1:36307:36307" # bind to local interface only! + volumes: + - ./data:/opt/sphinx/index # directory where sphinx will store index data + - ./sphinx.conf:/opt/sphinx/conf/sphinx.conf # SphinxSE configuration file + mem_limit: 512m # match indexer.value from sphinx.conf +``` + ## [Tags available](https://hub.docker.com/r/macbre/sphinxsearch/tags/) ### `3.0.3`, `latest` From 6837aa77762bf1e0e4db7c4cca6de78fd9f3a8a7 Mon Sep 17 00:00:00 2001 From: macbre Date: Tue, 25 Dec 2018 11:43:29 +0100 Subject: [PATCH 2/2] Use bitnami/minideb instead of debian base image Docker image size: 237 vs 189 MB (20% smaller) --- .gitignore | 1 + Dockerfile | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/Dockerfile b/Dockerfile index c0aa2fd..36caf95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,15 @@ # Dockerfile for Sphinx SE -FROM debian:stretch +# https://hub.docker.com/r/bitnami/minideb +FROM bitnami/minideb:stretch + +# https://sphinxsearch.com/blog/ ENV SPHINX_VERSION 3.0.3-facc3fb # install dependencies RUN apt-get update && apt-get install -y \ - default-libmysqlclient-dev \ - libpq-dev \ - wget - -# set timezone -# @see http://unix.stackexchange.com/a/76711 -RUN cp /usr/share/zoneinfo/CET /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata + default-libmysqlclient-dev \ + libpq-dev \ + wget # set up and expose directories RUN mkdir -pv /opt/sphinx/log /opt/sphinx/index