deploy with docker-compose.yaml

Hello,
Is there way to deploy app with docker-compose.yaml rather than Dockerfile?
Rgrds,
Bakyt

7 Likes

Not currently, unfortunately.

One approach is to make separate apps and then get them to communicate using the encrypted, private network (using .internal hostnames) …

or you would run multiple processes within one app. Then you would need an additional process in that app to keep them all running. For example using supervisor. This page has some more details about that multi-process approach:

1 Like

hey Greg,
thanks for ways out, but guess as a feedback, probably a nice feature to add, even if later on
cheers,

9 Likes

So I am trying also to get a multi machine setup working. Here is my issue.
I have two machines A and B
A needs to communicate with the public internet (https) and with B on a private network (http)
B needs to only communicate with A on a private network (http).

I have both machines registered in registry.fly.io

On local machine I use a docker compose. I use the machine name in my http calls in Machine A to call Machine B like http://machineb:8080

My question is how to setup my toml file ? Thanks!

Suggestion: next time, try creating a new topic, replying to an old topic (particularly one that has been solved) can easily be overlooked.

Let’s assume the following as a starting point:

app = "my-app"
primary_region = "iad"

[http_service]
  internal_port = 3000
  force_https = true
  auto_stop_machines = false
  auto_start_machines = true
  min_machines_running = 1
  processes = ["app"]

What that does is run one VM process named “app”, and makes it available via https on the public internet.

Next I’m going to assume that your Dockerfile builds all software needed to run both machines, the only difference is the CMD used to start each machine. If that’s the case, you can add the following to your fly.toml:

[processes]
app = "npm run start"
worker = "npm run worker"

Replace the npm commands with the commands you use to start your processes. Each process will be run in a separate machine, or even set of machines if you like. Make sure that app is the process that matches the http_service in the fly.toml.

Your Machine A can contact Machine B using the following DNS name:

worker.process.my-app.internal:8080

Where worker is from the process section and my-app is the value listed as app = at the top of the fly.toml file.

1 Like

So I had seen this toml config in the documentation. But my problem is I have two dockerfiles, each making a different “machine”. They are built seprately. one of my machines is python flask based and the other is nodejs based. are you suggesting one dockerfile with a layered build? Or can I have both machines deploy into the same fly app?

Two Dockerfiles would mean two images and two applications. Just put them in the same organization.

The first would have a [http_service] in its fly.toml. The second would not.

The default process name is app. Each of these machines can reference each other using the url pattern mentioned above. See also Private Networking · Fly Docs.

I mean why the hell on earth would you create Yet another configuration instead of supporting what has been industry standards for year and is already hard enough as it is.

How many PASS do we need until people get it right?

Support the god damn docker-compose.yml. No one wants or need to learn your configuration.

@thoughtsunificator It’s not immediately obvious (by the fact Fly supports Dockerfile) but they don’t actually use Docker behind the scenes. So that’s why they don’t (and unfortunately can’t) support docker-compose files.

2 Likes