I think i have a crude solution that might work out by controlling which children to load on start by passing an environment variable to our docker image for runtime and control the apps to load
def start(_type, _args) do
base = [
# Start the Ecto repository
GhostRider.Repo,
{Finch, name: GhostRiderFinch}
]
web = [
# Start the Telemetry supervisor
GhostRiderWeb.Telemetry,
# Start the PubSub system
{Phoenix.PubSub, name: GhostRider.PubSub},
# Start the Endpoint (http/https)
GhostRiderWeb.Endpoint,
# Start a worker by calling: GhostRider.Worker.start_link(arg)
# {GhostRider.Worker, arg},
]
children = case System.get_env("APP_LEVEL") do
"WEB" -> base ++ web
_ -> base
end
Is there an elegant way to control this loading using some other supervisor features ?