This guide is for apps that run on Fly Machines today. dply doesn't read fly.toml, but it builds your Dockerfile as it is, so most Fly apps run unchanged as container apps that sleep when idle.
How the pieces map
| Fly.io | dply |
|---|---|
| App | A container app |
Dockerfile |
Built as it is |
fly.toml |
Not read. Move the settings you need by hand (see below) |
[http_service] internal_port |
The EXPOSE port in your Dockerfile |
[deploy] release_command |
The release command: build.release in dply.yaml (Configuration files) |
[env] |
Environment (Environment variables) |
| Secrets | Environment |
[processes] |
The web process is the app; others become Queue workers (Queue workers) |
Machines, auto_stop_machines, min_machines_running |
Instances, Sleeps after and Min instances (Scaling & sleep) |
| Regions | Data regions |
| Volumes | Not available. Use object storage |
| Managed Postgres | dply Postgres (Postgres, MySQL & MongoDB) |
| Upstash Redis | dply Valkey (Valkey (Redis)) |
fly ssh console |
The app's Console, or dply-edge ssh from the CLI |
*.fly.dev |
The app's *.on-dply.live hostname (Domains) |
1. Check the port
dply sends traffic to the first EXPOSE port in your Dockerfile, or 8080 when there isn't one. Fly uses internal_port from fly.toml instead, so many Fly Dockerfiles have no EXPOSE. Add one with the port your app listens on:
EXPOSE 3000
A Procfile web: line doesn't change the start command of your own Dockerfile; its CMD is used. A release: line still runs. See Procfile.
2. Deploy the app
- Choose New app, connect your source control, and select the repository and branch.
- Check that dply found the
Dockerfileand shows App, then choose Deploy.
If fly.toml has a release_command, add it to dply.yaml:
build:
release: bin/rails db:migrate
3. Copy secrets and environment
fly secrets list shows only names and digests, not values. Take the values from where you keep them, or print them from a running Machine:
fly ssh console -C printenv
Copy the [env] values from fly.toml too. Paste everything into Environment on dply as KEY=value lines. Leave out DATABASE_URL and REDIS_URL: dply sets them from the resources you attach next.
4. Attach resources
On the app's Overview, choose Add resource and add a Database for Postgres and dply Valkey for Redis. Add Queue workers for each extra process group. Redeploy so the app receives the new variables.
5. Move the database
-
Stop writes to the Fly app.
-
Open a tunnel with
fly proxy(or use your managed database's connection string) and export:pg_dump --no-owner --no-acl -Fc "$FLY_DATABASE_URL" > app.dump -
Open the database from the app's Overview. Under Export and import, choose Get upload command, run it where
app.dumpis, then choose Load it.
See Postgres, MySQL & MongoDB.
6. Switch the domain
- Check the app on its
on-dply.liveaddress. - Add the domain under Routing, Domains.
- Lower the TTL on the existing record, then replace the A and AAAA records pointing at Fly with the CNAME target dply shows. Apex domains need an ALIAS, ANAME or flattened CNAME at most DNS providers.
- Choose Verify DNS and wait for TLS to be active.
- Remove the certificate from Fly with
fly certs remove, then scale the app to zero.
See Domains.