Reputation: 1107
We had an old PHP website that we have rewritten in elixir. The previous page was hosted in the "old fashioned" way, code deployed to an FTP, sql managed via phpmyadmin.
I'm using docker-compose
locally to run the database.
My plan is to host the new project on DigitalOcean by using only containers. I recently tried out docker-machine
and could use a DO VM just as it was a local machine. I also read about docker-swarm
but it is for multiple VMs with multiple containers for the same service.
My initial thought was to create just 1 docker-swarm
manager and connect to that via docker-machine
and execute a docker-compose
command.
The goal is to have a solution that can be automated and maybe have 1 or 2 backup containers. But I'd avoid having multiple VMs because the site has only a couple hundred visitors a day.
Is this a viable solution or is there a simpler approach?
Upvotes: 3
Views: 1673
Reputation: 323
If you want to avoid manual configurations but still get the required high availability and cost efficiency, try to run Docker Swarm template pre-packaged by Jelastic:
The details about the package and installation steps are in the article "Docker Swarm Auto-Clustering and Scaling with PaaS Power Armor."
Upvotes: 2
Reputation: 8596
Some quick guidelines:
docker stack deploy
commands and you'd keep using docker-compose
locally, and they could share same/similar compose files. The docker-compose command is just for local test/dev, and doesn't understand Swarm, but the file format is the same between the two.Upvotes: 3