Update Dockerfile
Browse files- Dockerfile +16 -16
Dockerfile
CHANGED
|
@@ -1,23 +1,23 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
RUN
|
| 13 |
-
RUN pnpm build
|
| 14 |
-
RUN pnpm ui:build
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
RUN chmod -R 777 /app
|
| 18 |
-
|
| 19 |
-
# Set target port routing to standard Hugging Face traffic hooks
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use an explicit Node user build to bypass the root permission block
|
| 2 |
+
FROM node:18-slim
|
| 3 |
|
| 4 |
+
# Set up required system packages safely
|
| 5 |
+
USER root
|
| 6 |
+
RUN apt-get update && apt-get install -y git python3 make g++ && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
+
# Set up a secure global npm folder that doesn't require root privileges
|
| 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 |
+
# Install the verified production release of the application
|
| 17 |
+
RUN npm install -g openclaw@latest
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# Expose the mandatory Hugging Face web-routing port
|
|
|
|
|
|
|
|
|
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
+
# Start the engine gateway on Hugging Face's exact port assignment
|
| 23 |
+
CMD ["openclaw", "gateway", "--port", "7860"]
|