After reading through the docs, fly.io looks like a perfect fit for my project. But I am not sure how to use the infrastructure correctly. Maybe you can point me in the right direction?
Here is what I would like to achieve:
- 1 shared redis for everything that follows
- 1 shared postgres for everything that follows
- 1 rails app for landing, product presentation, user registration, basic user dashboard, etc. reachable at domain.com
- The product is an dockerized django app talking to the common redis and postgres and with a volume attached for persistent django-config file and user storage
- Upon registration, rails provisions a VM with an isolated deployment of the product reachable at user.domain.com
- The user-VMs start when requests come in and stop when there are none
- The user-VMs are all based on the same docker container but contain different configurations and user data and should be isolated from each other
- The attached persistent volumes have limited available space for the users to fill up. Their space can be upgraded with the user dashboard in the rails application.
- I probably won’t need any horizontal scaling, but I would like the rails app to vertically scale single user-VMs on request.
What I have trouble to conceptualize is:
a) Do I create a fly-app for each provisioned django-container?
b) Do I create a fly-app only for the central rails application and programmatically add/provision standalone machines for the users?
c) I see that fly.io offers wildcard certificates. Is it possible to programmatically configure routes from subdomains to the correct user-VMs?
d) Can I configure a custom route for all unused sobdomains?
So how would I put the fly.io building blocks together to achieve something like that?
Any help or experience will be greatly appreciated. Thank you.