Deploy with Docker

Build and run your agent locally or on any Docker-compatible host.

Prerequisites

Step-by-step

1

Create your project

npx agentvoy create my-project --build-mode app --deploy-target docker --yes

This generates a Dockerfile, .dockerignore, and docker-compose.yml alongside your agent code.

2

Configure your environment

cd my-project-app
cp .env.example .env

Open .env and add your API key (e.g. OPENAI_API_KEY=sk-...).

3

Deploy with one command

agentvoy deploy --target docker

This runs docker build and docker run automatically. Your agent is now live at:

  • Agent API: http://localhost:8080
  • DevTools: http://localhost:8080/dev
  • Health: http://localhost:8080/health
4

(Alternative) Manual Docker commands

# Build the image
docker build -t my-project .

# Run the container
docker run -p 8080:8080 --env-file .env my-project

# Or use docker-compose
docker compose up
5

Dry run (generate files only)

agentvoy deploy --target docker --dry-run

Generates Dockerfile, .dockerignore, and docker-compose.yml without building or running.

Generated files

+ Dockerfile
+ .dockerignore
+ docker-compose.yml

Guard-to-Docker mapping

Your agent.guard.yml settings flow directly into the Dockerfile:

timeout: 5m → HEALTHCHECK interval
cost_limit: $1.00 → Container memory limit (512Mi)
allow_shell: false → Non-root Docker user