| title | Docker Deployment |
|---|---|
| description | Deploy DOAI Proxy using Docker and Docker Compose |
This guide walks you through deploying DOAI Proxy with Docker.
- Docker 20.10 or higher
- Docker Compose
- API key for your chosen provider (Straico, OpenAI, etc.)
# Clone from repository
git clone <repository-url>
cd doai-proxy
# OR copy project files to target machine:
# server.js, streaming.js, tools.js, utils.js,
# providers/, package.json, Dockerfile,
# docker-compose.yml, .env.examplecp .env.example .env
nano .env # add your provider's API keyFor Straico (default provider):
PROVIDER_TYPE=straico
STRAICO_API_KEY=your_actual_straico_api_key_here
STRAICO_API_URL=https://api.straico.com/v2
PROXY_PORT=8000docker-compose up -d --build
docker-compose ps
docker logs doai-proxycurl http://localhost:8000/health
# {"status":"ok","service":"doai-proxy","timestamp":"2026-02-04T23:30:00.000Z"}curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4.5",
"messages": [{"role": "user", "content": "Hello, world!"}],
"stream": false
}'For the full list of required and optional environment variables, provider-specific settings, and streaming tuning parameters, see the Configuration Guide.
You set these variables in your .env file before starting the container:
PROVIDER_TYPE=straico
STRAICO_API_KEY=your_straico_api_key
PROXY_PORT=8000
STREAM_CHUNK_SIZE=15
STREAM_DELAY_MS=80
LOG_LEVEL=infodocker-compose up -d # start
docker-compose down # stop
docker-compose restart # restart
docker logs doai-proxy -f # follow logsdocker-compose up -d --build
# or force a full recreate
docker-compose down
docker-compose up -d --build --force-recreatenano .env # edit variables
docker-compose restart # apply changesAfter the proxy is running, add a provider in OpenCode's configuration:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"straico": {
"npm": "@ai-sdk/openai-compatible",
"name": "Straico",
"options": {
"baseURL": "http://localhost:8000/v1"
}
}
},
"models": {
"anthropic/claude-sonnet-4.5": {
"name": "Anthropic: Claude Sonnet 4.5"
},
"deepseek/deepseek-chat": {
"name": "DeepSeek V3"
},
"openai/gpt-4o-mini": {
"name": "OpenAI: GPT-4o Mini"
}
}
}Then in OpenCode:
- Run
/modelsto refresh the model list - Select your provider and model
- Start chatting
The proxy listens on http://localhost:8000 by default.
Edit docker-compose.yml:
services:
doai-proxy:
ports:
- "0.0.0.0:8000:8000"Then access from other machines at http://<server-ip>:8000.
From the client machine:
ssh -L 8000:localhost:8000 user@serverThen use http://localhost:8000 as usual.
Use Nginx, Caddy, or similar for HTTPS and authentication:
server {
listen 80;
server_name your-proxy-domain.com;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}To run multiple provider instances simultaneously, use a compose file with separate services:
version: '3.8'
services:
doai-proxy:
build: .
container_name: doai-proxy
ports:
- "8000:8000"
env_file:
- .env.straico
restart: unless-stopped
volumes:
- ./.env.straico:/app/.env:ro
- ./logs:/app/logs
openai-proxy:
build: .
container_name: openai-proxy
ports:
- "8001:8001"
env_file:
- .env.openai
restart: unless-stopped
volumes:
- ./.env.openai:/app/.env:roCreate separate .env files for each provider:
# .env.straico
PROVIDER_TYPE=straico
STRAICO_API_KEY=your_straico_key
# .env.openai
PROVIDER_TYPE=openai
OPENAI_API_KEY=your_openai_key
PROXY_PORT=8001Start specific or all instances:
docker-compose up -d doai-proxy # Straico only
docker-compose up -d openai-proxy # OpenAI only
docker-compose up -d # alldocker logs doai-proxy
lsof -i :8000
docker-compose ps
sudo systemctl status dockerdocker-compose ps
docker port doai-proxy
curl http://localhost:8000/healthdocker exec doai-proxy cat /app/.env
docker exec doai-proxy env | grep API_KEY
docker exec doai-proxy env | grep PROVIDER_TYPETest your key directly with the provider:
curl https://api.straico.com/v2/models \
-H "Authorization: Bearer YOUR_API_KEY"Increase the timeout in .env:
STRAICO_API_TIMEOUT=120000 # 2 minutesCheck provider status and network connectivity:
curl https://api.straico.com/v2/health
ping api.straico.comEnable debug logging and inspect:
LOG_LEVEL=debug
docker-compose restart
docker logs doai-proxy | grep -i "tool_call"Adjust chunk size and delay in .env:
STREAM_CHUNK_SIZE=20 # larger chunks
STREAM_DELAY_MS=50 # faster delaySee Streaming Guide for tuning details.
docker logs doai-proxy
curl https://api.straico.com/v2/models \
-H "Authorization: Bearer YOUR_KEY"Check the logs for error details and verify the provider API is accessible.