deployment-gotchas

Installation
SKILL.md

Deployment Gotchas

Not a deployment guide — these are the 7 things that break every first Phoenix deploy. Every rule maps to a real production incident pattern.

RULES — Follow these with no exceptions

  1. Use runtime.exs for secrets and URLsconfig.exs/prod.exs are compiled into the release and cannot read env vars at boot
  2. Run migrations via release commands (bin/migrate)mix is not available in production releases
  3. Set PHX_HOST and PHX_SERVER=true — without these, URL generation breaks and the server won't start
  4. Run mix assets.deploy before building the release — forgetting this means no CSS/JS in production
  5. Never hardcode secrets — use System.get_env!/1 in runtime.exs (the ! crashes on boot if missing, which is what you want)
  6. Add a /health endpoint that queries the database — load balancers need it, and a 200-only check hides DB connection failures
  7. Use config :logger, level: :info in production:debug logs query parameters including user data

1. runtime.exs vs config.exs

The incident: App deploys fine but uses the wrong database URL. DATABASE_URL was set correctly in the environment, but the release ignores it.

Related skills
Installs
1
GitHub Stars
118
First Seen
Apr 21, 2026