Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +9 -17
Dockerfile
CHANGED
|
@@ -1,36 +1,28 @@
|
|
| 1 |
-
# Using Node 24 as per official docs
|
| 2 |
FROM node:24-bookworm
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
RUN apt-get update && apt-get install -y \
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
-
#
|
| 14 |
RUN git clone https://github.com .
|
| 15 |
|
| 16 |
-
#
|
| 17 |
RUN corepack enable
|
| 18 |
RUN pnpm install
|
| 19 |
RUN pnpm build
|
| 20 |
RUN pnpm ui:install
|
| 21 |
RUN pnpm ui:build
|
| 22 |
|
| 23 |
-
#
|
| 24 |
RUN npx playwright install chromium
|
| 25 |
|
| 26 |
-
# 5. Hugging Face Network Fixes
|
| 27 |
ENV NODE_ENV=production
|
| 28 |
-
ENV PORT=7860
|
| 29 |
-
# This matches the documentation's expected path for persistence
|
| 30 |
-
ENV OPENCLAW_HOME=/home/node/.openclaw
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
# 6. The Startup Command
|
| 35 |
-
# We use 'node dist/index.js' as per docs, but add the HF port and bind auto
|
| 36 |
CMD ["node", "dist/index.js", "gateway", "--port", "7860", "--bind", "auto", "--allow-unconfigured"]
|
|
|
|
|
|
|
| 1 |
FROM node:24-bookworm
|
| 2 |
|
| 3 |
+
# Add the browser libraries OpenClaw needs for "No API" mode
|
| 4 |
+
RUN apt-get update && apt-get install -y socat \
|
| 5 |
+
libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
|
| 6 |
+
libxkbcommon0 libxcomposite1 libxdamage1 libxext6 libxfixes3 \
|
| 7 |
+
libxrandr2 libgbm1 libasound2 \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# IMPORTANT: Clone the code so 'COPY' has something to find
|
| 13 |
RUN git clone https://github.com .
|
| 14 |
|
| 15 |
+
# Official Build Steps from your docs
|
| 16 |
RUN corepack enable
|
| 17 |
RUN pnpm install
|
| 18 |
RUN pnpm build
|
| 19 |
RUN pnpm ui:install
|
| 20 |
RUN pnpm ui:build
|
| 21 |
|
| 22 |
+
# Bake in the browser binary
|
| 23 |
RUN npx playwright install chromium
|
| 24 |
|
|
|
|
| 25 |
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
# Force port 7860 and public binding so Hugging Face can see it
|
|
|
|
|
|
|
|
|
|
| 28 |
CMD ["node", "dist/index.js", "gateway", "--port", "7860", "--bind", "auto", "--allow-unconfigured"]
|