From ef2c1df934ee7720fd1ccacae042f3deb3b7628d Mon Sep 17 00:00:00 2001 From: startxfr Date: Mon, 8 Dec 2014 02:35:03 +0100 Subject: adding function and startup script for last services images : memcache, nodejs, ooconv and postresql --- Services/ooconv/Dockerfile | 22 +++++++++++++--------- Services/ooconv/sx/ooconv.sh | 40 ++++++++++++++++++++++++++++++++++++++++ Services/ooconv/sx/ooconv_run.sh | 7 +++++++ 3 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 Services/ooconv/sx/ooconv.sh create mode 100644 Services/ooconv/sx/ooconv_run.sh (limited to 'Services/ooconv') diff --git a/Services/ooconv/Dockerfile b/Services/ooconv/Dockerfile index 0a50a0a..699f6de 100644 --- a/Services/ooconv/Dockerfile +++ b/Services/ooconv/Dockerfile @@ -1,12 +1,16 @@ +FROM startx/fedora +MAINTAINER Christophe LARUE +USER root +# Install packages and set up unoconv +RUN yum -y install unoconv libreoffice-headless libreoffice-writer libreoffice-calc pdftk gs \ + && yum clean all \ + && mkdir -p /tmp/ootmp +# Copy startx toolkit +COPY sx/* /sx/ +RUN chmod ug+rx /sx/ooconv* -FROM centos:latest -MAINTAINER startx dev@startx.fr +EXPOSE 2002 +VOLUME ["/tmp/ootmp"] -CMD rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm -CMD yum install --skip-broken -y --enablerepo=rpmforge unoconv libreoffice-headless libreoffice-writer libreoffice-calc -COPY unoconv /unoconv - -EXPOSE [2002] - -CMD ./unoconv --listener +CMD ["/sx/ooconv_run.sh"] \ No newline at end of file diff --git a/Services/ooconv/sx/ooconv.sh b/Services/ooconv/sx/ooconv.sh new file mode 100644 index 0000000..b41447c --- /dev/null +++ b/Services/ooconv/sx/ooconv.sh @@ -0,0 +1,40 @@ +#!/bin/bash +export TERM=dumb + +# Begin configuration before starting daemonized process +# and start generating host keys +function begin_config { + echo "=> Begin ooconv configuration for host $HOSTNAME" +} + +# End configuration process just before starting daemon +function end_config { + echo "=> End ooconv configuration ..." +} + +# Start the ooconv server in background. Used to perform config +# against the database structure such as user creation +function start_server { + echo "===> Starting ooconv server ..." + unoconv --listener & + sleep 4 +} + +# Stop the ooconv server running in background. +function stop_server { + echo "===> Stopping ooconv server ..." + killall unoconv + killall soffice.bin +} + +# Start the ooconv server as a deamon and execute it inside +# the running shell +function start_daemon { + echo "=> Starting ooconv daemon ..." + exec unoconv --listener +} + + +if [[ "$0" == *"ooconv.sh" && ! $1 = "" ]];then + eval "$@"; +fi \ No newline at end of file diff --git a/Services/ooconv/sx/ooconv_run.sh b/Services/ooconv/sx/ooconv_run.sh new file mode 100644 index 0000000..fadc29c --- /dev/null +++ b/Services/ooconv/sx/ooconv_run.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source /sx/ooconv.sh + +begin_config +end_config + +start_daemon \ No newline at end of file -- cgit v1.2.3