| FROM node:22-slim |
|
|
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV VIRTUAL_ENV=/opt/venv |
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv git && \ |
| python3 -m venv $VIRTUAL_ENV && \ |
| pip install --no-cache-dir huggingface_hub && \ |
| rm -rf /var/lib/apt/lists/* |
|
|
| COPY sync_data.py /app/sync_data.py |
| COPY entrypoint.sh /app/entrypoint.sh |
| RUN chmod +x /app/entrypoint.sh |
|
|
| |
| RUN npm install -g openclaw@latest |
|
|
| |
| RUN mkdir -p /root/.openclaw |
|
|
| |
| ENV PORT=7860 |
| ENV GATEWAY_MODE=local |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| RUN cat <<'EOF' > /usr/local/bin/start-openclaw |
| |
| set -x |
|
|
| |
| mkdir -p /root/.openclaw/agents/main/agent |
| mkdir -p /root/.openclaw/agents/main/sessions |
| mkdir -p /root/.openclaw/credentials |
|
|
| |
| rm -f /root/.openclaw/agents/main/agent/auth-profiles.json |
|
|
| |
| if [ ! -f /root/.openclaw/openclaw.json ]; then |
| cat <<JSON > /root/.openclaw/openclaw.json |
| { |
| "env": { |
| }, |
| "gateway": { |
| "mode": "local", |
| "bind": "lan", |
| "port": ${PORT}, |
| "trustedProxies": ["0.0.0.0/0"], |
| "auth": { |
| "mode": "token", |
| "token": "${GATEWAY_AUTH_TOKEN}" |
| }, |
| "controlUi": { |
| "allowInsecureAuth": true |
| } |
| }, |
| "agents": { |
| "defaults": { |
| "model": { |
| "primary": "nvidia/minimaxai/minimax-m2.1" |
| } |
| } |
| }, |
| "models": { |
| "providers": { |
| "nvidia": { |
| "baseUrl": "https://integrate.api.nvidia.com/v1", |
| "apiKey": "${MOONSHOT_API_KEY}", |
| "api": "openai-completions", |
| "models": [{ "id": "minimaxai/minimax-m2.1", "name": "minimax-m2.1" }] |
| } |
| } |
| }, |
| "channels": { |
| "telegram": { |
| "enabled": true, |
| "botToken": "${TG_BOT_TOKEN}", |
| "dmPolicy": "pairing" |
| } |
| } |
| } |
| JSON |
| fi |
|
|
| |
| chmod 700 /root/.openclaw |
| chmod 600 /root/.openclaw/openclaw.json || true |
| chmod 600 /root/.openclaw/agents/main/agent/auth-profiles.json || true |
|
|
| |
| openclaw doctor --fix |
|
|
| |
| echo "Starting OpenClaw gateway on port ${PORT}..." |
| exec openclaw gateway run --port ${PORT} |
| EOF |
|
|
| RUN chmod +x /usr/local/bin/start-openclaw |
|
|
| ENTRYPOINT ["/app/entrypoint.sh"] |
|
|
| CMD ["/usr/local/bin/start-openclaw"] |