Migrations Migrating from Heroku, Render, Hatchbox or Cloud 66? We move your production app within 48 hours →
Phoenix and Elixir

Phoenix and Elixir

Deploy Phoenix with Postgres, ClickHouse or Redis, Oban workers and migrations through the release.

  • Datastores from mix.exs: ecto_sql/postgrex → Postgres, ecto_ch/ch → ClickHouse, redix → Redis.
  • Migrations: mix ecto.migrate. Compiled releases have no mix at runtime, so Railyard finds the release wherever the image puts it and runs its migrator (bin/migrate if present, otherwise bin/<app> eval). mix phx.server becomes bin/<app> start the same way.
  • Variables read in config/runtime.exs (BASE_URL, HTTP_PORT, LISTEN_IP, DATABASE_URL, CLICKHOUSE_DATABASE_URL…) are wired automatically; SECRET_KEY_BASE is generated.
  • MIX_ENV=prod and PHX_SERVER=true are set.

Background jobs usually need no second process

Most Elixir apps run jobs with Oban — a Postgres-backed queue started from the same supervision tree as the web endpoint, so it’s already running the moment web boots, with no separate worker to declare or scale. That’s still the 12-factor model: the job runner is just one of the roles your single OTP release already plays, not a second deployable to keep in sync with the first.

If you do want a dedicated worker node — splitting job processing onto its own process so a slow queue can’t starve web requests — declare it in a Procfile and have your release read a flag or env var to skip starting the endpoint:

web: bin/my_app start
worker: bin/my_app eval "MyApp.Release.worker()"

Add or edit processes from the app’s Workers tab without a repo change, and scale either from the CLI:

railyard scale my-app worker=2

Config and secrets

Everything config/runtime.exs reads with System.get_env/2 is a plain var: set it under Variables, or railyard env:set my-app KEY=VALUE from the CLI, and the same compiled release runs unchanged from staging through production — dev/prod parity, not a different build per environment. Point at a database, ClickHouse or Redis running as its own service on the canvas with ${{redis.RAILYARD_PRIVATE_URL}} — resolved per environment. See Variables and secrets.

Deploy it

  • From a repo: paste the Git URL, or pick it from the picker once GitHub is connected — Railyard reads mix.exs, fills in ecto.migrate, the provisioned database and SECRET_KEY_BASE, and deploys on every push.
  • From the CLI: railyard create my-app https://github.com/me/my-app --addons postgres, or railyard git:remote && git push railyard main from inside the repo.
  • One click: add the deploy button to your README, or publish to the template catalog so anyone can launch it with its addons and variables already filled in.
Found an issue or have a question?
Theme
Colors