Update Dockerfile
Browse files- Dockerfile +7 -12
Dockerfile
CHANGED
|
@@ -1,23 +1,18 @@
|
|
| 1 |
-
# Use an explicit Node user build to bypass the root permission block
|
| 2 |
FROM node:18-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
USER root
|
| 6 |
RUN apt-get update && apt-get install -y git python3 make g++ && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
|
| 10 |
-
ENV PATH=$PATH:/home/node/.npm-global/bin
|
| 11 |
-
|
| 12 |
-
# Switch to the default non-root user that Hugging Face expects
|
| 13 |
USER node
|
| 14 |
WORKDIR /home/node/app
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
RUN npm install
|
| 18 |
|
| 19 |
-
# Expose
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
CMD ["openclaw", "gateway", "--port", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM node:18-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies required for native node-gyp compilation
|
| 4 |
USER root
|
| 5 |
RUN apt-get update && apt-get install -y git python3 make g++ && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
+
# Switch back to the standard application user
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
USER node
|
| 9 |
WORKDIR /home/node/app
|
| 10 |
|
| 11 |
+
# Force an explicit, local isolated deployment to run native compiler scripts safely
|
| 12 |
+
RUN npm install openclaw@latest --omit=dev
|
| 13 |
|
| 14 |
+
# Expose Hugging Face's mandatory routing port
|
| 15 |
EXPOSE 7860
|
| 16 |
|
| 17 |
+
# Point execution directly to the locally isolated binary folder
|
| 18 |
+
CMD ["./node_modules/.bin/openclaw", "gateway", "--port", "7860"]
|