I have a docker-compose with 2 images that I use for local development. Now I want to apply this setup to my production setup on DigitalOcean.
How do I do this? I have tried to follow this docs.docker.com/machine/examples/ocean but I feel I'm fooling around without knowing enough what I'm doing.
It seems that I can't just boot up a droplet with my docker-compose? So somehow I must change something so it communicates between 2 servers instead of just 2 containers? And how do I set up a server from my docker image? As I can see I can't just apply it as an image to DigitalOcean, I have to install Docker and install it through there?
Right now it seems a bit blurry to me and maybe easier just to create my own script that uses DigitalOceans API to install through SSH commands and maybe that's a better solution to avoid Docker in the middle?
Matt Strom
Software Engineer, TypeScript ninja
Not having used DigitalOcean, I cannot say for certain, but based on the tutorial you linked to, I don't think DigitalOcean supports
docker-composein the way you are hoping. (Like you mentioned it does look like you can stand up a VM of your own to serve as the Docker host.)Compose uses a control plane that sits above the images that you bring up together as a stack. If you're trying to run containers on a remote docker-machine, I suspect you are not allowed to manage that machine's control plane, virtual network interfaces, etc.
I've used AWS Elastic Container Service (ECS) to deploy compose stacks for production. With ECS, you are interacting your own EC2 instance, but Amazon has abstracted away a lot of the management necessary there. AWS has also recently introduced Fargate which adds enhancements for cluster management on top of what ECS offers.
While these are even bigger guns, you might also explore Docker Swarm or Kubernetes for cluster management and orchestration.