EdgeAIG commited on
Commit
474a3a3
·
verified ·
1 Parent(s): 4e9f16d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -16
Dockerfile CHANGED
@@ -1,23 +1,23 @@
1
- FROM node:18
 
2
 
3
- # Update package lists, install git, and install pnpm globally
4
- RUN apt-get update && apt-get install -y git && npm install -g pnpm
 
5
 
6
- WORKDIR /app
 
 
7
 
8
- # Ensure we pull the exact target repository URL
9
- RUN git clone https://github.com /app
 
10
 
11
- # Run installation, core engine compilation, and UI production build steps
12
- RUN pnpm install
13
- RUN pnpm build
14
- RUN pnpm ui:build
15
 
16
- # Open open directory access rules to fit Hugging Face's sandbox permissions
17
- RUN chmod -R 777 /app
18
-
19
- # Set target port routing to standard Hugging Face traffic hooks
20
  EXPOSE 7860
21
 
22
- # Launch the gateway application service directly on port 7860
23
- CMD ["pnpm", "clawdbot", "gateway", "--port", "7860"]
 
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"]