Run a task in phoneix app release involving Ecto Repo

So I have a phoneix app and its bundled in a container so by default it has no mix and using the procedure defined here for running migration using eval but for cases where I would like to trigger some task from the same image for example interact with data to fetch or import etc is there a way to just start the Ecto Repo and not all children for the app. The only thing that has worked for me is to do Application.ensure_all_started(@app) before interacting with Ecto Repo but this also start the Web app which is not needed. In Ruby on Rails under rails rake would not start the webserver but load the environment to have DB available for interaction. Is it possible to have something like that ? Or is it ok to have the Web running (one of the concern is it will require its own resource while being idle). Ecto.Migator seems to be special where load works for it but to execute some module intreracting with db need to do ensure_all_started/1. I have added get_applications to show a simple use case. Also if I had scheduled workers or some background jobs they might get triggered in this approach as well. so whats the best practice for this ? To have a separate container for tasks ? Use Mix instead of Elixir releases but then there is this Always use Releases

defmodule GhostRider.Release do
  @moduledoc """

  @app :ghost_rider

  def migrate do

    for repo <- repos() do
      {:ok, _, _} = Ecto.Migrator.with_repo(repo, &, :up, all: true))

  def rollback(repo, version) do
    {:ok, _, _} = Ecto.Migrator.with_repo(repo, &, :down, to: version))

  def get_applications() do
    GhostRider.Repo.all(GhostRider.Integrated.Application) |> IO.inspect()
    IO.puts("Finished task")

  def create do

  defp repos do
    Application.fetch_env!(@app, :ecto_repos)

  defp load_app do

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
      {Finch, name: GhostRiderFinch}
    web =  [
      # Start the Telemetry supervisor
      # Start the PubSub system
      {Phoenix.PubSub, name: GhostRider.PubSub},
      # Start the Endpoint (http/https)
      # 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

Is there an elegant way to control this loading using some other supervisor features ?