Deploy an Elixir / Phoenix application on onesubnet
Deploy Phoenix/Elixir: mix deps, release, port and environment variables.
Deploy an Elixir / Phoenix application on onesubnet
onesubnet runs your Elixir/Phoenix applications (fault tolerance, real-time). Deploy via Git.
1. Prepare the project
- A
mix.exsat the root. - Phoenix reads the port via
PORT(endpoint configured inconfig/runtime.exs):
config :my_app, MyAppWeb.Endpoint,
http: [ip: {0, 0, 0, 0}, port: String.to_integer(System.get_env("PORT") || "4000")]
2. Deploy
- Connect your Git repository in the panel.
- Build command:
mix deps.get && mix assets.deploy - Start command:
mix phx.server(ormix releasethen_build/prod/rel/my_app/bin/my_app start).
3. Environment variables
DATABASE_URL, SECRET_KEY_BASE… in Settings → Environment.
4. Logs
Live console in the panel. Phoenix uses Elixir’s Logger module.
References
- Phoenix: https://hexdocs.pm/phoenix/
- Elixir: https://hexdocs.pm/elixir/