| FROM node:22-slim |
|
|
| |
| RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN npm install -g openclaw@latest |
|
|
| |
| RUN mkdir -p /root/.openclaw |
|
|
| |
| ENV PORT=18000 |
| ENV OPENCLAW_GATEWAY_MODE=local |
| ENV OPENCLAW_GATEWAY_PASSWORD=${OPENCLAW_GATEWAY_PASSWORD} |
|
|
| |
| EXPOSE 18000 |
|
|
| |
| RUN echo '#!/bin/bash\n\ |
| set -x\n\ |
| \n\ |
| |
| |
| if [ -z '$GEMINI_APIKEY' ]; then\n\ |
| echo 'ERROR: GEMINI_APIKEY is not set. Agent will fail. Exiting.'\n\ |
| exit 1\n\ |
| fi\n\ |
| \n\ |
|
|
| |
| mkdir -p /root/.openclaw/agents/main/agent\n\ |
| mkdir -p /root/.openclaw/agents/main/sessions\n\ |
| mkdir -p /root/.openclaw/credentials\n\ |
| \n\ |
|
|
| |
| rm -f /root/.openclaw/agents/main/agent/auth-profiles.json\n\ |
| \n\ |
|
|
| |
| if [ ! -f /root/.openclaw/openclaw.json ]; then\n\ |
| cat > /root/.openclaw/openclaw.json << EOF\n\ |
| {\n\ |
| 'env': {\n\ |
| 'GOOGLE_API_KEY': '${GEMINI_APIKEY}',\n\ |
| 'GEMINI_API_KEY': '${GEMINI_APIKEY}',\n\ |
| 'GOOGLE_GENERATIVE_AI_API_KEY': '${GEMINI_APIKEY}',\n\ |
| 'PALM_API_KEY': '${GEMINI_APIKEY}'\n\ |
| },\n\ |
| 'gateway': {\n\ |
| 'mode': 'local',\n\ |
| 'bind': 'lan',\n\ |
| 'port': 18000,\n\ |
| 'trustedProxies': ['0.0.0.0/0'],\n\ |
| 'auth': {\n\ |
| 'mode': 'token',\n\ |
| 'token': '${OPENCLAW_GATEWAY_PASSWORD}'\n\ |
| },\n\ |
| 'controlUi': {\n\ |
| 'allowInsecureAuth': true\n\ |
| }\n\ |
| },\n\ |
| 'agents': {\n\ |
| 'defaults': {\n\ |
| 'model': {\n\ |
| 'primary': 'google/gemini-1.5-pro'\n\ |
| }\n\ |
| }\n\ |
| }\n\ |
| }\n\ |
| EOF\n\ |
| fi\n\ |
| \n\ |
| |
| chmod 700 /root/.openclaw\n\ |
| chmod 600 /root/.openclaw/openclaw.json\n\ |
| chmod 600 /root/.openclaw/agents/main/agent/auth-profiles.json\n\ |
| \n\ |
| |
| openclaw doctor --fix\n\ |
| \n\ |
| |
| echo 'Starting OpenClaw gateway on port 18000...'\n\ |
| exec openclaw gateway run --port 18000\n\ |
| ' > /usr/local/bin/start-openclaw && chmod +x /usr/local/bin/start-openclaw |