> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Deployment

> Deploy agents with Docker

# Docker Deployment

Deploy your agents using Docker containers.

## Dockerfile

```dockerfile theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8000

CMD ["python", "main.py"]
```

## requirements.txt

```
praisonaiagents>=0.1.0
```

## main.py

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from praisonaiagents.api import serve

agent = Agent(
    name="Production Agent",
    instructions="You are a helpful assistant."
)

if __name__ == "__main__":
    serve(agent, host="0.0.0.0", port=8000)
```

## Build and Run

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Build
docker build -t my-agent .

# Run
docker run -p 8000:8000 \
  -e OPENAI_API_KEY=$OPENAI_API_KEY \
  my-agent
```

## Docker Compose

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
version: '3.8'

services:
  agent:
    build: .
    ports:
      - "8000:8000"
    environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - DATABASE_URL=postgresql://postgres:postgres@db:5432/praisonai
    depends_on:
      - db

  db:
    image: postgres:15
    environment:
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=praisonai
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  postgres_data:
```

## Run with Compose

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
docker-compose up -d
```

## Related

* [Deployment Overview](/docs/guides/deployment/overview) - All deployment options
* [Deploy Module](/docs/sdk/praisonai/deploy) - Deploy API
