Update Dockerfile
Browse files- Dockerfile +15 -2
Dockerfile
CHANGED
|
@@ -7,19 +7,32 @@
|
|
| 7 |
FROM node:22-slim
|
| 8 |
|
| 9 |
# Install system dependencies
|
|
|
|
| 10 |
RUN apt-get update && apt-get install -y \
|
| 11 |
nginx \
|
| 12 |
ca-certificates \
|
| 13 |
curl \
|
| 14 |
netcat-openbsd \
|
| 15 |
git \
|
|
|
|
|
|
|
|
|
|
| 16 |
--no-install-recommends && \
|
| 17 |
rm -rf /var/lib/apt/lists/*
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
# Install OpenClaw globally via npm
|
| 20 |
# Installs to /usr/local/lib/node_modules/openclaw — NOT /app
|
| 21 |
# So /app/package.json will never exist in this image
|
| 22 |
-
RUN npm
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Remove default nginx site
|
| 25 |
RUN rm -f /etc/nginx/sites-enabled/default \
|
|
@@ -41,4 +54,4 @@ RUN chmod +x /app/entrypoint.sh /app/security-check.sh /app/start.sh && \
|
|
| 41 |
|
| 42 |
USER root
|
| 43 |
EXPOSE 7860
|
| 44 |
-
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
|
|
| 7 |
FROM node:22-slim
|
| 8 |
|
| 9 |
# Install system dependencies
|
| 10 |
+
# python3/make/g++ are needed to compile native npm modules
|
| 11 |
RUN apt-get update && apt-get install -y \
|
| 12 |
nginx \
|
| 13 |
ca-certificates \
|
| 14 |
curl \
|
| 15 |
netcat-openbsd \
|
| 16 |
git \
|
| 17 |
+
python3 \
|
| 18 |
+
make \
|
| 19 |
+
g++ \
|
| 20 |
--no-install-recommends && \
|
| 21 |
rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
+
# Make git fetch dependencies over https instead of ssh
|
| 24 |
+
RUN git config --global url."https://github.com/".insteadOf ssh://git@github.com/ && \
|
| 25 |
+
git config --global url."https://github.com/".insteadOf git@github.com:
|
| 26 |
+
|
| 27 |
+
# To pin a version, change "latest" to e.g. 2026.x.x
|
| 28 |
+
ARG OPENCLAW_VERSION=latest
|
| 29 |
+
|
| 30 |
# Install OpenClaw globally via npm
|
| 31 |
# Installs to /usr/local/lib/node_modules/openclaw — NOT /app
|
| 32 |
# So /app/package.json will never exist in this image
|
| 33 |
+
RUN npm config set fetch-retries 5 && \
|
| 34 |
+
npm config set fetch-retry-mintimeout 20000 && \
|
| 35 |
+
npm install -g openclaw@${OPENCLAW_VERSION} --no-audit --no-fund
|
| 36 |
|
| 37 |
# Remove default nginx site
|
| 38 |
RUN rm -f /etc/nginx/sites-enabled/default \
|
|
|
|
| 54 |
|
| 55 |
USER root
|
| 56 |
EXPOSE 7860
|
| 57 |
+
ENTRYPOINT ["/app/entrypoint.sh"]
|