Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Only one host for production environment. What to use: docker-compose or single node swarm? #8
We have recently moved all our corporative services to run ONE DigitalOcean server having all services in a docker environment: redmine, dokuwiki, opends, mattermost, a docker registry, portainer,...
The way we did it, was creating all the needed docker-compose files (one by service, and having all the needed containers in each one: RoR+postgresql, Node+Mongo+redis,...), add all the needed mountpoints for the volumes (and almost all containers must be persistent), and include the option in all of them with "restart: always". All this apps were started with 'docker-compose -d up", and in this way this only ONE server is able to run all services (and all of them get started with server startup). We don't need a cluster right now.
We don't know if this approach is a good one or it shouldn't be used for production (and why in this case). We want to have one server to pay the less as possible, and taking into account that it can manage all our apps. Should we create a swarm, move all containers to be swarm services, but only have one manager and no workers? I would be that approach a better option?
If this is true, what should we use to replace the use of jwilder/nginx-proxy (and docker-letsencrypt-nginx-proxy-companion) to manage http redirections and automatic generation of letsencrypt certificates.
Thanks in advance!
I always recommend single-node Swarm with the assumptions you know the risks of a single node of anything, and you're backing up persistent data, keys/secrets, etc.
My top reasons for a single-node Swarm over docker-compose:
There's more, but that's my big ticket heavy hitters!
Go for a one swarm master node, for all @BretFisher says
For your second point, go give a try to https://github.com/containous/traefik