I have several compose files (docker-compose.yml) describing a simple Django application (five containers, three images).
I want to launch this stack during production - so that the entire stack starts at boot, and that the containers are restarted or recreated if they fail. There are no volumes that I care about, and the containers will not contain any important condition and can be recycled at will.
I did not find much information about using specially selected dockers in production this way. The documentation is useful, but nothing is said about starting at boot, and I am using Amazon Linux, so there is no (currently) access to the docker machine. I'm used to using supervisord for babysit processes and ensuring that they start loading, but I donโt think this is the way to do this with Docker containers, since they are ultimately under the control of the Docker daemon?
As a simple start, I just want to put restart: always on all my services and make an init script to execute docker-compose up -d on boot. Is there a recommended way to efficiently manage the stack to build dockers?
EDIT: I'm looking for a โsimpleโ way to safely execute the docker-compose up equivalent for my container stack. I know in advance that all containers declared on the stack can be on the same machine; in this case, I do not need to configure containers from the same stack in multiple instances, but it is also useful to know.
source share