David Kimura Would you please allow me to clarify your view on production level architecture? You are suggesting to use managed DB and object storage services outside of your Portainer cluster. How would you setup in the 'docker-compose.yml.erb' in this case? Also if you want to add other additional services like Sidekiq, ElasticSearch, and AnyCable, how would you use your Portainer clusters? Do you see your Portainer clusters as specific to application server functions?
This is really useful tutorial! Thank you so much.
If you need other services like Sidekiq, ElasticSearch or anything else, you would be able to add the appropriate services in the docker-compose files. Yes, the DB, redis and other services (outside of the app services) should go on the managed services. This would provide a certain level of backups appropriately.
It's also not ideal that the postgres, redis, etc are dockerized (whether it is in the docker swarm or kubernetes) since the service could become unhealthy and reboot at any point in time. Since these aren't redundant services, it could bring down the application unexpectedly while they're being restarted.
If you wanted to use managed services, you could still use the docker swarm and portainer. You'd need to pass the environment variables through to the app services which can be done through portainer or some other mechanism.
I like Kubernetes, but I think it adds a lot of knowledge requirement in the creation of the yaml files, config and server maintenance that Docker Swarm doesn't have. For hobby projects and in general, many may not want to get too deep into the infrastructure side of things that would otherwise be unavoidable with Kubernetes.
If you're going the route of AWS, App Runner or Elastic Beanstalk may be considerations. There are episodes on both of those. If you do go the route of Beanstalk, set up your own database instead of provisioning one through the Beanstalk wizard. This will provide some separation of Beanstalk and your database if you ever decide to switch to something like App Runner, ECS or EKS.
For Digital Ocean, I am not comfortable enough with their App Platform yet. The last time I tried it, there were several issues around my project using esbuild instead of webpacker and couldn't successfully deploy. I've been monitoring their release notes page and haven't seen anything to indicate that this issue is fixed.
It also greatly depends on your application needs. Do you need to have multiple regions and load balancing between multiple web services?
Thanks David, I think I will try Beanstalk. I just watched your videos on them last night, and left another comment about credentials. I do not need multiple regions, so Beanstalk is probably the way to go. I would rather deploy on AWS as I am more familiar with that anyway. Cheers.
This is really useful tutorial! Thank you so much.
It's also not ideal that the postgres, redis, etc are dockerized (whether it is in the docker swarm or kubernetes) since the service could become unhealthy and reboot at any point in time. Since these aren't redundant services, it could bring down the application unexpectedly while they're being restarted.
If you wanted to use managed services, you could still use the docker swarm and portainer. You'd need to pass the environment variables through to the app services which can be done through portainer or some other mechanism.
I am planning to migrate an app off Heroku.
For Digital Ocean, I am not comfortable enough with their App Platform yet. The last time I tried it, there were several issues around my project using esbuild instead of webpacker and couldn't successfully deploy. I've been monitoring their release notes page and haven't seen anything to indicate that this issue is fixed.
It also greatly depends on your application needs. Do you need to have multiple regions and load balancing between multiple web services?