DEV Community

Discussion on: My app is built.. but Docker deployments have me confused. Help!

Collapse
 
ykyuen profile image
Yuen Ying Kit

Running a Docker project locally for development and production could be quite a different scenario.

For local development, it is very likely that all containers and volumes are run in a single Docker server which is ur local machine. And you already get it done with tool like docker-compose.

But when it comes to production environment, running everything in a single docker server doesn't sound good as it couldn't utilize the benefit of container-base application which is the ease of scaling because you could only vertically scale it by giving more computational power and RAM to that single server.

That's why there are clustering tools like docker swarm and kubernetes for container orchestration. In that case, you could scale your application horizontally by creating more containers across multiple docker servers to handle the workload.

To run a container-base application on a docker cluster has many new concepts. Ex.

  1. how to load balance the workload across multiple containers
  2. rolling update the containers... etc

On the other hand, you also need to consider things like

  1. whether ur containers are stateful or stateless?
  2. persistent storage... etc

I suggest either docker swarm and kubernetes is good to go. Docker swarm should be easier to setup and should have a more gentle learning curve compared with k8s.

I haven't played with docker machine before and as far as i know it is quite similar to vagrant for provisioning a server instance. If u find it problematic, i think u could skip it and just provision the docker servers manually and start playing with docker swarm directly.


P.S. I also hv some freelance projects with production running on a single docker server because they are small projects and probably don't need scaling up. =P