LemonCore. Runtime. Boot
(lemon_core v0.1.0)
View Source
Orchestrates the Lemon runtime boot sequence.
This module centralises the startup logic that previously lived in the
bin/lemon shell script. The script is kept as a thin CLI wrapper that
sets environment variables and then calls into this module.
Boot sequence
- Load
.envfromdotenv_dir(if present). - Reject dev Erlang distribution cookie in production releases.
- Apply port values from the resolved
Envstruct to the OTP application environment. - Start each application in the requested
Profilein order.
Usage (from a mix eval or release boot)
LemonCore.Runtime.Boot.start(:runtime_full)
# with explicit env override
env = %LemonCore.Runtime.Env{control_port: 5050}
LemonCore.Runtime.Boot.start(:runtime_min, env: env)
Summary
Functions
Starts a Lemon runtime using the given profile name.
Options
:env- aLemonCore.Runtime.Envstruct; defaults toEnv.resolve/0.:dotenv_dir- override the dotenv directory (default:env.dotenv_dir).:check_running- whentrue(default), abort if a runtime is already running on the control-plane port.
Like start/2 but halts the BEAM on failure.
Used by bin/lemon where the process runs with --no-halt — without this,
a boot failure would leave the BEAM sitting idle with no apps running and
no error visible to the user.
Returns a summary of which apps in profile_name are currently started.