From 77fbb5f8336ce026592e7f2e1160e6b7864dd373 Mon Sep 17 00:00:00 2001 From: hylom Date: Mon, 26 Feb 2018 19:46:22 +0900 Subject: [PATCH] test-container: create ns_searchd related files --- test-container/Dockerfile_for_searchd | 20 ++++++++++++++++++++ test-container/build_for_searchd.sh | 1 + test-container/run_ns_searchd.sh | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 test-container/Dockerfile_for_searchd create mode 100644 test-container/build_for_searchd.sh create mode 100755 test-container/run_ns_searchd.sh diff --git a/test-container/Dockerfile_for_searchd b/test-container/Dockerfile_for_searchd new file mode 100644 index 00000000..c29a8bba --- /dev/null +++ b/test-container/Dockerfile_for_searchd @@ -0,0 +1,20 @@ +FROM debian:stretch +MAINTAINER hirom@osdn.jp + +ENV PYLUCENE_DEB=python-lucene_4.10.1+osdn-1_amd64.deb + +# install basic packages +RUN apt-get update -y +RUN apt-get install -y vim-nox lv less + +# install python and lucene packages +RUN apt-get install -y pylucene python-mysql.connector liblucene4.10-java libasm-java +RUN apt-get install -y python-yaml + +# install custom pylucene package +COPY files/$PYLUCENE_DEB /tmp +RUN dpkg -i /tmp/$PYLUCENE_DEB + +COPY files/newslash.cnf /etc/mysql/conf.d/ +EXPOSE 6000 + diff --git a/test-container/build_for_searchd.sh b/test-container/build_for_searchd.sh new file mode 100644 index 00000000..49bb40e2 --- /dev/null +++ b/test-container/build_for_searchd.sh @@ -0,0 +1 @@ +docker build -f Dockerfile_for_searchd -t ns_searchd . diff --git a/test-container/run_ns_searchd.sh b/test-container/run_ns_searchd.sh new file mode 100755 index 00000000..9da1bccc --- /dev/null +++ b/test-container/run_ns_searchd.sh @@ -0,0 +1,19 @@ +#!/bin/sh +#IMAGE=jessie_mojolicious +IMAGE=ns_searchd +DEV_DIR=${HOME}/mojolicious/src +CONTAINER_NAME=ns_searchd +SD_DB=sradcompose_srad-db_1 +NETWORK=--network=srad_test +CMD="python /var/newslash/ns_search/ns_searchd.py" +CAP="--memory=2gb" +ENV_OPT="" +OPTS="$CAP --link $SD_DB:sd-db --link newslash-db --link newslash-redis --link $SD_MASTER:sd-master -v ${DEV_DIR}:/var/newslash -p 6000:6000 --name $CONTAINER_NAME $ENV_OPT $NETWORK" +docker rm $CONTAINER_NAME +if [ $# -eq 0 ]; then + docker run -ti $OPTS $IMAGE $CMD +else + docker run -ti $OPTS $IMAGE "$@" +fi + + -- 2.11.0