Using claw.zip with Docker
Deploying AI applications with Docker? Configure claw.zip through environment variables for clean, portable deployments. OpenClaw users can add claw.zip to any containerized stack without changing application code β just inject the environment variables.
Before You Start
Prerequisites
- βDocker installed
- βA working AI application
- βA claw.zip account and API key
Step-by-Step
Integration Steps
Set environment variables
Create a .env file for your Docker deployment with the claw.zip configuration.
# .env
ANTHROPIC_API_KEY=your_openclaw_key
CLAWZIP_API_KEY=your_clawzip_key
ANTHROPIC_BASE_URL=https://api.claw.zipCreate a Dockerfile
Build a Dockerfile for your AI application. The claw.zip config is passed via environment variables.
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "server.js"]Use docker-compose
Use docker-compose to manage environment variables and deployment.
# docker-compose.yml
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- CLAWZIP_API_KEY=${CLAWZIP_API_KEY}
- ANTHROPIC_BASE_URL=https://api.claw.zip
restart: unless-stoppedConfigure your application
Read the base URL from environment variables in your application code.
const Anthropic = require('@anthropic-ai/sdk');
const client = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com',
defaultHeaders: {
'x-api-key': process.env.CLAWZIP_API_KEY,
},
});Deploy
Build and run your container with claw.zip configured.
docker-compose up -d --buildDone
You Are All Set
Your Dockerized application now routes all OpenClaw API calls through claw.zip. The configuration is clean, portable, and works across all deployment environments.
More Guides