Question

One droplet for multiple docker containers with traefik as reverse proxy

Posted February 7, 2020 727 views
Docker

Hello guys,

sorry if this question was asked way before, I just cant find it.

Now my question is. Is it possible to run multiple docker containers on 1 droplet with traefik as reverse proxy? Here is the thing. I want to create SPA with my own BE based on NodeJS with my own Postgres db. So I need 3 docker containers for my project.

Question is, is one droplet good for this kind of project? If yes, its possible to use traefik as proxy and if so, which droplet is good for it?

Thank you :)

Best regards

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

I want to create SPA with my own BE based on NodeJS with my own Postgres db. So I need 3 docker containers for my project.

Sure, you can definitely do that. If you are planning to stick to Docker, then I highly recommend using Docker Compose to write the service scripts and the connections between your Docker images and containers.

https://docs.docker.com/compose/

is one droplet good for this kind of project?

One droplet of what size? It would be good for testing/development purposes. For anything related to production-grade, consider using suitable resources. 4 vCPU and somewhere around 16 GB of RAM would be a good combination for production.

Last but not least, you can also use the Managed Kubernetes service on DigitalOcean. The service creation is similar to Docker, and provides extra support for:

  1. Availability
  2. Scalability
  3. Storage management
  4. Secrets and credential management (useful for API keys, etc.)

This is what I would recommend.

If yes, its possible to use traefik as proxy,

Yes, Traefik supports Kuberenetes (if you decide to use Kubernetes) as an Ingress controller and can easily be used as a proxy for your services. Read more on this here and here.

by Keith Thompson
Docker can be an easy and efficient way to run web applications, but you may want to run multiple applications on the same Docker host. In this situation, you'll need to set up a reverse proxy since you only want to expose ports 80 and 443 to the...
Submit an Answer