# `Puck.Sandbox.Runtime.Template`
[🔗](https://github.com/bradleygolden/puck/blob/v0.2.25/lib/puck/sandbox/runtime/template.ex#L1)

Reusable sandbox configuration template.

## Example

    template = Puck.Sandbox.Runtime.Template.new(adapter: MyAdapter, config: %{image: "python:3.12"})
    {:ok, sandbox} = Puck.Sandbox.Runtime.create(template)

    # With overrides
    {:ok, sandbox} = Puck.Sandbox.Runtime.create(@python_template, memory_mb: 1024)

# `t`

```elixir
@type t() :: %Puck.Sandbox.Runtime.Template{adapter: module(), config: map()}
```

# `merge`

Merges override config into template config.

Uses deep merge for nested maps, with overrides taking precedence.

## Examples

    template = Template.new({Docker, %{image: "python", memory_mb: 256}})
    merged = Template.merge(template, %{memory_mb: 512, cpu: 2})
    # => %{image: "python", memory_mb: 512, cpu: 2}

# `new`

Creates a new template.

## Examples

    # Keyword syntax
    Template.new(adapter: Docker, config: %{image: "python:3.12"})

    # Tuple syntax (same as Runtime.create/1)
    Template.new({Docker, %{image: "python:3.12", memory_mb: 512}})
    Template.new({Docker, image: "python:3.12", memory_mb: 512})

# `to_backend`

Returns the backend tuple for `Runtime.create/1`.

## Examples

    template = Template.new({Docker, %{image: "python"}})
    Template.to_backend(template)
    # => {Docker, %{image: "python"}}

    Template.to_backend(template, %{memory_mb: 512})
    # => {Docker, %{image: "python", memory_mb: 512}}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
