LXCize FrontlineSMS setup

This commit is contained in:
Disassembler 2018-09-13 19:57:14 +02:00
parent 7dbfe8533c
commit 01fc001990
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 9 additions and 14 deletions

View File

@ -1,12 +1,7 @@
#!/bin/sh #!/bin/sh
set -e set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/frontlinesms SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
# Build Docker container
docker build -t frontlinesms ${SOURCE_DIR}
cp ${SOURCE_DIR}/etc/init.d/frontlinesms /etc/init.d/frontlinesms
rc-update -u
# Configure FrontlineSMS # Configure FrontlineSMS
mkdir -p /srv/frontlinesms/data 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 envsubst <${SOURCE_DIR}/srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties
chown -R 8018:8018 /srv/frontlinesms/data chown -R 8018:8018 /srv/frontlinesms/data
vmmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}" 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

View File

@ -1,17 +1,13 @@
#!/sbin/openrc-run #!/sbin/openrc-run
description="FrontlineSMS docker container" description="FrontlineSMS container"
depend() { depend() {
need docker need cgroups
} }
start() { start() {
/usr/bin/docker run -d --rm \ lxc-start frontlinesms
--name frontlinesms \
-h frontlinesms \
-v /srv/frontlinesms/data:/srv/frontlinesms/.frontlinesms2 \
frontlinesms
} }
start_post() { start_post() {
@ -23,5 +19,5 @@ stop_pre() {
} }
stop() { stop() {
/usr/bin/docker stop frontlinesms lxc-stop frontlinesms
} }