feat(deploy): add volcengine-102 production deployment

Multi-stage Dockerfile (Node frontend build + Python runtime),
docker-compose with agenteval (port 8002) and openclaw-eval containers.
This commit is contained in:
sinohqb 2026-07-20 15:33:44 +08:00
parent affbf60945
commit 5b1c88065b
3 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# AgentEvalTool production environment — volcengine-102
# Generate secret: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
AGENTEVAL_API_KEY=
AGENTEVAL_SECRET_KEY=
AGENTEVAL_ALLOWED_ORIGINS=["https://agenteval.solahqb22.cn"]
AGENTEVAL_OPENCLAW_UPSTREAM=http://openclaw-eval:18789
AGENTEVAL_OPENCLAW_WS_UPSTREAM=ws://openclaw-eval:18789
AGENTEVAL_OPENCLAW_PROXY_USER=agenteval
AGENTEVAL_OPENCLAW_AUTH_TOKEN=change-me-in-production
AGENTEVAL_WEBHOOK_URL=
AGENTEVAL_WEBHOOK_SECRET=

View File

@ -0,0 +1,47 @@
# Multi-stage build: Node compiles React frontend, Python runs backend.
# Frontend dist is baked into the image (no runtime volume mount needed).
FROM node:20-alpine AS frontend-build
WORKDIR /app/frontend/web
COPY frontend/web/package.json frontend/web/package-lock.json* ./
RUN npm ci --silent
COPY frontend/web/ ./
RUN npm run build
FROM python:3.11.15-slim-bookworm AS runtime
WORKDIR /app
ARG BUILD_COMMIT=unknown
ARG BUILD_TIME=unknown
ENV AGENTEVAL_BUILD_COMMIT=${BUILD_COMMIT}
ENV AGENTEVAL_BUILD_TIME=${BUILD_TIME}
ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
ENV PIP_TRUSTED_HOST=mirrors.aliyun.com
RUN sed -i \
-e 's|deb.debian.org|mirrors.aliyun.com|g' \
-e 's|security.debian.org|mirrors.aliyun.com/debian-security|g' \
/etc/apt/sources.list.d/debian.sources 2>/dev/null || true
RUN sed -i \
-e 's|deb.debian.org|mirrors.aliyun.com|g' \
-e 's|security.debian.org|mirrors.aliyun.com/debian-security|g' \
/etc/apt/sources.list 2>/dev/null || true
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc curl \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml README.md alembic.ini ./
COPY migrations ./migrations
COPY backend ./backend
RUN pip install --no-cache-dir -e .
COPY --from=frontend-build /app/frontend/web/dist ./frontend/web/dist
COPY config/config.example.json ./config/config.json
COPY data/scenarios ./data/scenarios
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost:8000/api/health || exit 1
CMD ["sh", "-c", "alembic upgrade head && agenteval server start --host 0.0.0.0 --port 8000"]

View File

@ -0,0 +1,32 @@
services:
agenteval:
build:
context: ../..
dockerfile: deploy/volcengine-102/Dockerfile
args:
BUILD_COMMIT: "${BUILD_COMMIT:-unknown}"
BUILD_TIME: "${BUILD_TIME:-unknown}"
image: agenteval:${IMAGE_TAG:-latest}
container_name: agenteval
ports:
- "8002:8000"
env_file:
- .env
volumes:
- agenteval_data:/app/data
restart: unless-stopped
openclaw-eval:
image: ghcr.io/openclaw/openclaw:latest
container_name: openclaw-eval
ports:
- "28789:18789"
volumes:
- openclaw_eval_data:/home/node/.openclaw
environment:
- AGENTEVAL_API_URL=http://agenteval:8000
restart: unless-stopped
volumes:
agenteval_data:
openclaw_eval_data: