Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile -- HF Space deployment (optimized)
|
| 2 |
+
FROM node:22-slim
|
| 3 |
+
|
| 4 |
+
# 1. System deps (minimal)
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
python3 python3-pip ca-certificates curl \
|
| 7 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
# 2. Install OpenClaw at build time (cached)
|
| 10 |
+
RUN npm install -g openclaw@latest --unsafe-perm --no-audit --no-fund
|
| 11 |
+
|
| 12 |
+
# ~/.openclaw/bin 已经在 PATH 中
|
| 13 |
+
|
| 14 |
+
# 3. Copy app files
|
| 15 |
+
WORKDIR /app
|
| 16 |
+
COPY backup-manager.py .
|
| 17 |
+
COPY config-generator.py .
|
| 18 |
+
COPY start-openclaw.sh .
|
| 19 |
+
COPY scripts/ ./scripts/
|
| 20 |
+
RUN chmod +x start-openclaw.sh scripts/*.sh
|
| 21 |
+
|
| 22 |
+
# 4. Environment
|
| 23 |
+
ENV PORT=18888 \
|
| 24 |
+
OPENCLAW_STATE_DIR=/root/.openclaw \
|
| 25 |
+
HOME=/root \
|
| 26 |
+
NODE_OPTIONS=--max-old-space-size=512 \
|
| 27 |
+
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com \
|
| 28 |
+
NODE_ENV=production
|
| 29 |
+
|
| 30 |
+
EXPOSE 18888
|
| 31 |
+
CMD ["./start-openclaw.sh"]
|