OSDN Git Service

test-container: create ns_searchd related files
authorhylom <hylom@users.sourceforge.jp>
Mon, 26 Feb 2018 10:46:22 +0000 (19:46 +0900)
committerhylom <hylom@users.sourceforge.jp>
Mon, 26 Feb 2018 10:46:22 +0000 (19:46 +0900)
test-container/Dockerfile_for_searchd [new file with mode: 0644]
test-container/build_for_searchd.sh [new file with mode: 0644]
test-container/run_ns_searchd.sh [new file with mode: 0755]

diff --git a/test-container/Dockerfile_for_searchd b/test-container/Dockerfile_for_searchd
new file mode 100644 (file)
index 0000000..c29a8bb
--- /dev/null
@@ -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 (file)
index 0000000..49bb40e
--- /dev/null
@@ -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 (executable)
index 0000000..9da1bcc
--- /dev/null
@@ -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
+
+