This is on an Ubuntu 14.04 LTS VM running Docker and I suspect respawn
is the cause of my problem but not sure of the ideal solution.
Current upstart script (cat /etc/init/dockersuitecrm.conf
)
description "Start docker containers"
author "Batman"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
docker-compose -f /usr/bin/myapp/docker-compose.yml -p myapp start
end script
This 'works' in that myapp
is alive and responsive but /sbin/init
takes up all the CPU when I monitor with htop
. If I remove the entry from upstart (sudo rm /etc/init/dockersuitecrm.conf
) and manually SSH in and run docker-compose -f /usr/bin/myapp/docker-compose.yml -p myapp start
I don't see the cpu at 100% issue and as before myapp
is again alive and responsive.
So I suspect the way I'm starting docker-compose above is incorrect. What's the right way to start docker-compose
is always running without manual intervention?
EDIT: Shouldn't matter but /usr/bin/myapp -> /home/batman/dockerapps/myapp
as a symbolic link.
respawn
command in the script. – DeepSpace101 Apr 30 '15 at 18:50docker-compose start
. – Mark Lopez Jun 19 '15 at 17:53script
block. Maybe that is part of the problem? I havechdir /usr/bin/myapp/
and on the next lineexec docker-compose up
instead. – jmreicha Jul 09 '15 at 22:26docker-compose up -d
– KCD Dec 01 '16 at 22:49