diff --git a/frontlinesms/setup.sh b/frontlinesms/setup.sh index 9a8d029..77c4dc3 100755 --- a/frontlinesms/setup.sh +++ b/frontlinesms/setup.sh @@ -1,12 +1,7 @@ #!/bin/sh set -e -SOURCE_DIR=$(realpath $(dirname "${0}"))/frontlinesms - -# Build Docker container -docker build -t frontlinesms ${SOURCE_DIR} -cp ${SOURCE_DIR}/etc/init.d/frontlinesms /etc/init.d/frontlinesms -rc-update -u +SOURCE_DIR=$(realpath $(dirname "${0}"))/setup # Configure FrontlineSMS mkdir -p /srv/frontlinesms/data @@ -17,3 +12,7 @@ export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base6 envsubst <${SOURCE_DIR}/srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties chown -R 8018:8018 /srv/frontlinesms/data vmmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}" + +# Install service +cp ${SOURCE_DIR}/etc/init.d/frontlinesms /etc/init.d/frontlinesms +rc-update -u diff --git a/frontlinesms/setup/etc/init.d/frontlinesms b/frontlinesms/setup/etc/init.d/frontlinesms index 4713582..1de62ec 100755 --- a/frontlinesms/setup/etc/init.d/frontlinesms +++ b/frontlinesms/setup/etc/init.d/frontlinesms @@ -1,17 +1,13 @@ #!/sbin/openrc-run -description="FrontlineSMS docker container" +description="FrontlineSMS container" depend() { - need docker + need cgroups } start() { - /usr/bin/docker run -d --rm \ - --name frontlinesms \ - -h frontlinesms \ - -v /srv/frontlinesms/data:/srv/frontlinesms/.frontlinesms2 \ - frontlinesms + lxc-start frontlinesms } start_post() { @@ -23,5 +19,5 @@ stop_pre() { } stop() { - /usr/bin/docker stop frontlinesms + lxc-stop frontlinesms }