Hi
We’re new to fly.io and we have three web-applications we’d like to host on fly.
Those are three rails-apps share Postgres, Redis, Memcache, since they all act on the same data. Let’s call them backoffice, selfcare and web.
All of those are in the same domain and each use a separate subdomain:
backoffice.rails-app.com, selfcare.rails-app.com and web.rails-app.com
Therefore we built a single docker-image with an endpoint-script capable to start each of those apps.
At our present hoster, which is VM-based, we use an nginx-reverse-proxy, which serves the public files and makes the tls through “let’s encrypt”.
We are now reflecting about the new architecture on fly.io.
Two scenarios make sense for us:
Scenario 1:
We have one app with three processes (which will start their own virtual machines)
Scenario 2
We have three apps, one for each application
Since we have only one docker-image, we would prefer scenario 1.
The difficultiy lies in the service section. As I understand, we can have one “http_service-section”, but multiple “services” sections.
So we’d need to define three services
[processes]
app = '/rails/backoffice/bin/rails server -p 3000'
web = '/rails/web/bin/rails server -p 4000'
selfcare = '/rails/selfcare/bin/rails server -p 5000'
# backoffice
[[services]]
internal_port = 3000
protocol = "tcp"
processes = ['app']
# web
[[services]]
internal_port = 4000
protocol = "tcp"
processes = ['web']
# selfcare
[[services]]
internal_port = 5000
protocol = "tcp"
processes = ['selfcare']
The question is now, is the ingress capable to route the traffic to our three different rails-apps, based on the given subdomains, and how ?
Further we would need to give the statics-section a hint of which app has which static-path
[[statics]]
guest_path = '/rails/backoffice/public'
url_prefix = '/'
processes = ['app']
-
Is there a possibility we can handle these scenarios through the fly-ingress (or loadbalancer?) or do we need an additional app with our own nginx-reverse-proxy?
-
And if we provide an nginx-app: how can we route to e.g. the selfcare-process or selfcare-app as an upstream, if we scale those vm’s? Can we adress it as selfcare.internal and will this be loadbalanced again?
-
Can we add multiple certificates to one app?
Thanks a lot in advance for any suggestions or hints