How to start Oban and Web separately from each other

Hi! I am new to elixir and phoenix, so sorry for stupid question :slight_smile:

I have basic Phoenix application and after setup Oban based on docs, having:

# config/config.exs
config :app, Oban,
  engine: Oban.Engines.Basic,
  queues: [default: 10],
  repo: App.Repo
# lib/app/application.ex
defmodule App.Application do
  # See https://hexdocs.pm/elixir/Application.html
  # for more information on OTP Applications
  @moduledoc false

  use Application

  @impl true
  def start(_type, _args) do
    children = [
      AppWeb.Telemetry,
      App.Repo,
      {DNSCluster, query: Application.get_env(:app, :dns_cluster_query) || :ignore},
      {Phoenix.PubSub, name: App.PubSub},
      # Start the Finch HTTP client for sending emails
      {Finch, name: App.Finch},
      # Start a worker by calling: App.Worker.start_link(arg)
      # {App.Worker, arg},
      # Start to serve requests, typically the last entry
      AppWeb.Endpoint,
      {Oban, oban_config()}
    ]

    # See https://hexdocs.pm/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: App.Supervisor]
    Supervisor.start_link(children, opts)
  end

  # Tell Phoenix to update the endpoint configuration
  # whenever the application is updated.
  @impl true
  def config_change(changed, _new, removed) do
    AppWeb.Endpoint.config_change(changed, removed)
    :ok
  end

  defp oban_config do
    config = Application.get_env(:app, Oban)

    if Code.ensure_loaded?(IEx) && IEx.started?() do
      config
      |> Keyword.put(:crontab, false)
      |> Keyword.put(:queues, false)
    else
      config
    end
  end
end

And I am trying to understand how to start Web nodes and Oban processing nodes separately, meaning Web nodes should note process Oban jobs, and Oban node should not process Web requests and should not start Endpoint.

Founded this doc - Splitting Queues Between Nodes — Oban v2.19.1 but what I understand is that on running mix phx.server Endpoint will be started to server http requests.

Could you please help to understand what is the proper way to do it?

Maybe something like this?

  def start(_type, _args) do
    children = [
      AppWeb.Telemetry,
      App.Repo,
      {DNSCluster, query: Application.get_env(:app, :dns_cluster_query) || :ignore},
      {Phoenix.PubSub, name: App.PubSub},
      # Start the Finch HTTP client for sending emails
      {Finch, name: App.Finch},
      # Start a worker by calling: App.Worker.start_link(arg)
      # {App.Worker, arg}
    ]

    # See https://hexdocs.pm/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: App.Supervisor]
    Supervisor.start_link(children ++ node_applications(System.get_env("NODE_TYPE")), opts)
  end

  defp node_applications("oban"), do: [{Oban, oban_config()}]
  defp node_applications(_web), do: [AppWeb.Endpoint]

Thank you! Will try it out.