I have a node app that serves HTTP requests and caches stuff in Redis. While I was able to get a basic setup working by following the guides, I’d like to automate some of this stuff as “infrastructure as code” when deploying services into test, staging or production “organisations”.
I have some questions along these lines:
-
There’s a dependency between the node app and Redis and as I understand, I have to maintain two different
fly.toml
files for them. Is there something akin to docker-compose in fly.io that allows you to declare a dependency between them and bring them up at once? -
I prefer to use shared-cpu-1x VM but with 512MB memory instead of the 256MB default. Is there a way to do that automatically as part of the app configuration without running
fly scale memory
?I’d like to do this because someone could forget about running that command when setting up services in a new organization. (I’m guessing the answer here is no because App Configuration (fly.toml) makes no mention of such a setting).
-
Along similar lines, is there a way to pick up secrets for a fly app from a dotenv file or another source, instead of having to manually enter secrets through the
flyctl secrets
command? -
As hinted at above, I’d like to maintain seperate test, staging and production environments for my fly apps, and as I understand I’d have to maintain three different sets of
fly.toml
files. Coming from AWS Cloudformation where you could could dynamically change the AWS account ID without maintaining different file sets, I find this approach a bit messy to say the least. Is there a better approach that I’m unaware of?
Thanks in advance for your time.