---
title: Running your own container | Runware Docs
url: https://runware.ai/docs/serverless/examples/container-server
description: Deploy a vLLM image as it ships, and declare the port, the probes and the routes your server already answers.
relatedDocuments:
  - https://runware.ai/docs/serverless/bringing-a-container
  - https://runware.ai/docs/serverless/deploying
---
## Introduction

vLLM, deployed as it is. The image is the one its maintainers publish and the server is the one they wrote, so the whole app is a `Dockerfile` with no `COPY` in it and a `container.yaml` beside it.

Qwen3 4B Instruct is Apache 2.0 and ungated, so you deploy it with **no token**.

## Building the image

**Dockerfile**:

```docker
# vLLM's own image, with nothing added to it. The platform finds the vLLM inside
# and attaches its own serving layer, so there is no integration line here.
FROM vllm/vllm-openai:v0.28.0

# HF_HOME points at the volume the deploy mounts. Without it the weights land on
# the sandbox filesystem and are fetched again on every cold start.
#
# PORT is the one container.yaml declares. Not 8000, which the platform binds
# inside the pod along with 8888, 8889 and 9090.
ENV MODEL=Qwen/Qwen3-4B-Instruct-2507 \
    MAX_MODEL_LEN=8192 \
    GPU_MEMORY_UTILIZATION=0.3 \
    HF_HOME=/weights \
    PORT=8080

EXPOSE 8080

# A plain `vllm serve`. `sh -c` so the variables above are read at container
# start, and `exec` so vllm receives the signals the platform sends.
ENTRYPOINT ["/bin/sh", "-c", \
  "exec vllm serve \"$MODEL\" --port \"$PORT\" --max-model-len \"$MAX_MODEL_LEN\" --gpu-memory-utilization \"$GPU_MEMORY_UTILIZATION\""]
```

Nothing is copied in and nothing is installed by you, which is the point of bringing a container: **the environment is already the one you want**.

## The serving layer the platform attaches

This image carries vLLM's own label, so the platform serves it under NVIDIA Dynamo: **the plain `vllm serve` in the entrypoint starts a Dynamo worker and a Dynamo frontend** on the port you named, with `--enable-sleep-mode` added so the model can move off the card between calls and come back at the same addresses. The image is not modified and its own packages are not touched.

[Bringing a container](https://runware.ai/docs/serverless/bringing-a-container#vllm-images) has the rules behind that: which vLLM releases the path accepts, what an image outside them gets, what happens to a vLLM-Omni image carrying the same label, and how the flags your entrypoint passes are split between the engine and the frontend.

`HF_HOME` moves the weights to the path the volume backs. Leave it out and they land on the sandbox filesystem, where every cold start fetches them again.

## Declaring the contract

**container.yaml**:

```yaml
configVersion: 1

# The --port the entrypoint passes to `vllm serve`.
port: 8080

# Readiness and liveness are separate routes, and under the platform's serving
# layer they are two different servers. /health answers once a server that can
# take requests is up, /live reports the process.
probes:
  readiness: /health
  liveness: /live

timeouts:
  requestSeconds: 300
  # The first boot pulls the weights into the volume. Later boots read them back.
  startupSeconds: 1200

# vLLM's own route, written out, so nothing in the image translates the request.
endpoints:
  - path: v1/chat/completions
    input:
      type: object
      additionalProperties: false
      required: [messages]
      properties:
        model: { type: string }
        messages: { type: array }
        max_tokens: { type: integer }
        temperature: { type: number }
        top_p: { type: number }
        seed: { type: integer }
```

A code app has its endpoints read out of your source. **A builder cannot look inside an image and find the routes**, so a container app declares them: the port its server listens on, the two probe routes, how long a request may take, and every endpoint the platform may route to.

## Deploying the app

container-serverrtx-pro-6000[source](https://github.com/Runware/runware-serverless-examples/tree/main/container-server)

[One-click deploy](https://runware.ai/serverless/apps?template=container-server)

**From a URL**:

```bash
runware serverless deploy --from https://runware.ai/docs/serverless/examples/container-server.zip
```

**From a clone**:

```bash
runware serverless deploy --container . \
  --id container-server \
  --gpu-type rtx-pro-6000 \
  --volume /weights
```

## Paths and targets

An endpoint path can be **several lowercase segments joined by slashes**, so vLLM's own route goes straight in `path` and nothing in the image translates the request.

`target` is for the case where the two differ, when the route your server answers on is not the one you want callers to invoke. This example does not need it.

## Choosing a port

> [!WARNING]
> The platform binds **8000, 8888, 8889 and 9090** inside the pod, and 8000 is vLLM's own default. A server left on one of those loses the bind to whatever got there first, so moving it is the first thing this Dockerfile does.

## Readiness and liveness

Readiness and liveness are routes you choose, and they answer different questions. **Readiness says the server can serve**, which is what the platform waits for before sending traffic. **Liveness says the process is still worth keeping**, and it is only read once the startup probe has passed.

vLLM answers `/health` as soon as its engine can serve, so both read the same route here. A server of your own that starts listening before it is loaded wants two routes rather than one: a liveness that answers immediately, and a readiness that waits.

## Calling the app

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })

const task = await client.invoke({
  appId: 'container-server',
  endpointPath: 'v1/chat/completions',
  payload: {
    model: 'Qwen/Qwen3-4B-Instruct-2507',
    messages: [
      {
        role: 'user',
        content: 'Name three uses for a serverless GPU.'
      }
    ]
  }
}, {
  deliveryMethod: 'sync'
})
```

**Python**:

```python
import asyncio
import os

from runware import InvokeOptions, Runware

async def main():
    client = Runware(api_key=os.environ["RUNWARE_API_KEY"])
    try:
        task = await client.invoke(
            "container-server",
            "v1/chat/completions",
            {
                "model": "Qwen/Qwen3-4B-Instruct-2507",
                "messages": [
                    {
                        "role": "user",
                        "content": "Name three uses for a serverless GPU."
                    }
                ]
            },
            options=InvokeOptions(delivery_method="sync"),
        )
    finally:
        await client.close()

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.serverless.runware.ai/v1/apps/container-server/invoke-sync/v1/chat/completions \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "payload": {
      "model": "Qwen/Qwen3-4B-Instruct-2507",
      "messages": [
        {
          "role": "user",
          "content": "Name three uses for a serverless GPU."
        }
      ]
    }
  }'
```

**CLI**:

```bash
cat <<'EOF' | runware serverless apps invoke container-server v1/chat/completions --sync -f -
{
  "model": "Qwen/Qwen3-4B-Instruct-2507",
  "messages": [
    {
      "role": "user",
      "content": "Name three uses for a serverless GPU."
    }
  ]
}
EOF
```

**JSON**:

```json
{
  "taskId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "payload": {
    "model": "Qwen/Qwen3-4B-Instruct-2507",
    "messages": [
      {
        "role": "user",
        "content": "Name three uses for a serverless GPU."
      }
    ]
  }
}
```

The body is an ordinary chat-completions request, and `model` is the one the entrypoint serves.

**The reply is the server's own response body, verbatim**, at `output.choices[0].message.content`. A code app's answer arrives wrapped at `output.predictions[0]`, and a container app's does not.

The `input` block in `container.yaml` is closed, so a field it does not name is refused at the queue rather than forwarded, and streaming is refused the same way. An invocation answers once, so there is no response to stream into.

**A declared `input` is enforced before your container is called.** A request with no `messages` comes back `422` with a pointer at the field, and the worker never sees it. Leave `input` out of an endpoint and the payload is forwarded as it stands.