Spotter-VM/sahana-demo/etc/init.d/sahana-demo

33 lines
726 B
Plaintext
Executable File

#!/sbin/openrc-run
description="Sahana Eden Demo docker container"
depend() {
need docker postfix postgres
}
start() {
/usr/bin/docker run -d --rm \
--name sahana-demo \
-h sahana-demo \
--link postfix \
--link postgres \
-v /srv/sahana-demo/conf:/srv/web2py/applications/eden/models \
-v /srv/sahana-demo/data/${TEMPLATE}:/srv/web2py/applications/eden/modules/templates/${TEMPLATE} \
-v /srv/sahana-demo/data/databases:/srv/web2py/applications/eden/databases \
-v /srv/sahana-demo/data/uploads:/srv/web2py/applications/eden/uploads \
sahana
}
start_post() {
/usr/bin/vmmgr register-proxy sahana-demo
}
stop_pre() {
/usr/bin/vmmgr unregister-proxy sahana-demo
}
stop() {
/usr/bin/docker stop sahana-demo
}