Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# fly.toml app configuration file generated for teleplay on 2026-04-08T20:41:32Z
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'teleplay'
primary_region = 'ams'

[build]
dockerfile = "Dockerfile"

[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
memory_mb = 1024
Comment on lines +20 to +23
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In Fly.io fly.toml [[vm]] configuration, can memoryandmemory_mb be set together? If both are present, which one takes precedence, and is this officially supported?

💡 Result:

Yes—flyctl will accept both memory and memory_mb in a [[vm]] stanza, because [[vm]] is decoded into a Compute struct that has both a memory field and an inlined MachineGuest (which includes memory_mb). The config reference, however, documents only memory for the [[vm]] section. [1]

If both are present, which wins?

In flyctl’s computeToGuest() implementation, it:

  1. Parses memory (string with units) and sets guest.MemoryMB, then
  2. Copies fields from compute.MachineGuest (where memory_mb lives) onto guest afterwards (with “ignore empty” semantics).

So, memory_mb takes precedence over memory when both are set (assuming memory_mb is non-zero). [2]

Is this “officially supported”?

  • Official fly.toml reference: documents memory, not memory_mb. So “set both and rely on precedence” is not something the reference specifies/supports. [1]
  • Fly’s own docs/examples: some official guides use memory_mb in fly.toml examples (so memory_mb is clearly supported by tooling/docs in practice). [3]
  • Machines API field: the underlying Machine “guest” schema uses memory_mb as the canonical field. [4]

Practical takeaway: don’t set both; pick one. If you do set both, memory_mb wins in current flyctl. [2]

Sources:
[1] Fly.io config reference ([[vm]] / memory) (fly.io)
[2] flyctl source (computeToGuest: parses memory then applies memory_mb) (github.com)
[3] Fly.io “Use a MySQL Database” guide using memory_mb in fly.toml (fly.io)
[4] Fly Machines API schema (memory_mb) (fly.io)

Citations:


Remove memory_mb to conform to the official fly.toml specification.

The [[vm]] section officially documents only memory, not memory_mb. Having both fields present is unsupported: when set together, memory_mb silently takes precedence over memory, creating potential for unexpected configuration drift. Keep only memory (currently set to 1gb).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@fly.toml` around lines 20 - 23, The fly.toml currently defines both memory
and memory_mb in the VM config, which is unsupported; remove the memory_mb =
1024 entry so only memory = '1gb' remains, leaving cpu_kind and cpus unchanged;
update any comments or related documentation referencing memory_mb and ensure no
other code or scripts rely on memory_mb instead of memory.