OpenClaw / Dockerfile
Murasame52's picture
Update Dockerfile
b7bd795 verified
Raw
History Blame Contribute Delete
1.12 kB
FROM node:22-slim
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
RUN npm install -g openclaw@latest
ENV PORT=18789
EXPOSE 18789
CMD sh -c '\
if [ -z "$OPENAI_API_KEY" ]; then echo "ERROR: OPENAI_API_KEY not set"; exit 1; fi; \
if [ -z "$OPENAI_MODEL" ]; then echo "ERROR: OPENAI_MODEL not set"; exit 1; fi; \
echo "Using OPENAI_MODEL: $OPENAI_MODEL"; \
echo "Using OPENAI_BASE_URL: ${OPENAI_BASE_URL:-not set}"; \
SPACE_URL="${HF_SPACE_URL:-https://murasame52-openclaw.hf.space}"; \
mkdir -p /root/.openclaw; \
printf "{\n \"gateway\": {\n \"mode\": \"local\",\n \"bind\": \"lan\",\n \"port\": 18789,\n \"auth\": {\n \"mode\": \"none\"\n },\n \"autoApprove\": true,\n \"controlUi\": {\n \"allowInsecureAuth\": true,\n \"allowedOrigins\": [\"*\", \"%s\"]\n }\n },\n \"agents\": {\n \"defaults\": {\n \"model\": \"openai/%s\"\n }\n }\n}\n" "$SPACE_URL" "$OPENAI_MODEL" > /root/.openclaw/openclaw.json; \
[ -n "$OPENAI_BASE_URL" ] && export OPENAI_BASE_URL; \
exec openclaw gateway run --port 18789'