Hi All,
I’ve got a docker-compose which runs all our services. We run an app with users in 30+ countries. It’s Sept. 22, do we have a better support for docker-compose?
Trying to wrap my head around running each service in the docker-compose independently.
Please see my current docker-compose attached
.
nginx
service serves as our reverse proxyapi
service has 4 instances (nodejs, express, apollo-server e.t.c)db
service – using postgres imageredis-master
service – usingbitnami/redis
imageredis-replica
service – usingbitnami/redis
image- A bunch of environment variables attached via
[env]:
./.env`
So I’m looking at the following workflow, please correct me if I’m mistaken:
- Convert the docker-compose instance into separate dockerfiles and keep different
- For the Node Express service i.e (
api
), according to my docker compose, I’ll have that in one dockerfile with its environment variables and a separate fly app. - For the nginx service, another separate fly app and its own dockerfile
- I have AWS RDS instance which I can move over to fly postgres cluster to replace the
db
service and pass the connection string. - I have redis-master and redis-replica which I can move over to fly redis (though not sure how to setup the master/slave on fly)
Questions:
- Are there any other recommendation to ensure this is a performant, yet cost effective setup?
- Latency is a massive issue which is why we’re looking to migrate to fly.io. How can we scale our
api
(graphql) and postgresql instances to better serve our users? - Any thought on how to manage environment variables in fly.toml? Can I just copy the
.env
section in the docker-compose and add tofly.toml
file instance of an app? - Regarding cost, looking at the description above, will the monthly cost likely to be significant? We are bootstrapping and paying for services out-of-pocket atm so every little help