#!/sbin/openrc-run

description="CKAN docker container"

depend() {
	need docker net postgres
	use dns logger netmount postfix
	after ckan-datapusher redis solr
}

start_pre() {
	/srv/ckan/update-ip.sh
}

start() {
	/usr/bin/docker run -d --rm \
	--name ckan \
	-h ckan \
	--link ckan-datapusher \
	--link postfix \
	--link postgres \
	--link redis \
	--link solr \
	--link ckan-datapusher \
	-p 127.0.0.1:8003:8003 \
	-v /srv/ckan/conf:/etc/ckan \
	-v /srv/ckan/data:/srv/ckan/storage \
	ckan
}

stop() {
	/usr/bin/docker stop ckan
}
