File size: 1,022 Bytes
77a1110
 
 
 
 
88efacc
77a1110
 
 
 
 
88efacc
 
 
77a1110
 
 
 
 
 
 
 
88efacc
77a1110
 
 
88efacc
 
77a1110
 
 
 
88efacc
 
77a1110
88efacc
77a1110
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Dockerfile -- HF Space deployment (optimized)
FROM node:22-slim

# 1. System deps (minimal)
RUN apt-get update && apt-get install -y --no-install-recommends \
    python3 python3-pip python3-requests ca-certificates curl \
    && rm -rf /var/lib/apt/lists/*

# 2. Install OpenClaw at build time (cached)
RUN npm install -g openclaw@latest --unsafe-perm --no-audit --no-fund

# 3. Install Caddy (reverse proxy)
RUN curl -fsSL https://caddy.org/install | bash

# ~/.openclaw/bin 已经在 PATH 中

# 3. Copy app files
WORKDIR /app
COPY backup-manager.py .
COPY config-generator.py .
COPY start-openclaw.sh .
COPY scripts/ ./scripts/
COPY Caddyfile .
RUN chmod +x start-openclaw.sh scripts/*.sh

# 4. Environment
ENV PORT=7860 \
    OPENCLAW_GATEWAY_PORT=18889 \
    OPENCLAW_STATE_DIR=/root/.openclaw \
    HOME=/root \
    NODE_OPTIONS=--max-old-space-size=512 \
    NPM_CONFIG_REGISTRY=https://registry.npmmirror.com \
    NODE_ENV=production \
    ALLOW_HTTP_BASIC_OVER_HTTP=1

EXPOSE 7860
CMD ["./start-openclaw.sh"]