Spaces:
Running on Zero
Running on Zero
Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Node.js 24
|
| 2 |
+
FROM node:24-bullseye
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Create a non-root user first
|
| 8 |
+
RUN useradd -m -u 1000 user
|
| 9 |
+
RUN chown -R user:user /app
|
| 10 |
+
|
| 11 |
+
# Switch to the user BEFORE installing
|
| 12 |
+
USER user
|
| 13 |
+
|
| 14 |
+
# Install OpenClaw locally in /app
|
| 15 |
+
RUN npm install openclaw@latest
|
| 16 |
+
|
| 17 |
+
# Set environment variables
|
| 18 |
+
ENV PATH="/app/node_modules/.bin:${PATH}" \
|
| 19 |
+
OPENCLAW_PORT=7860 \
|
| 20 |
+
HOME=/home/user
|
| 21 |
+
|
| 22 |
+
# Expose the port
|
| 23 |
+
EXPOSE 7860
|
| 24 |
+
|
| 25 |
+
# Start the gateway using the local path
|
| 26 |
+
CMD ["npx", "openclaw", "gateway", "start"]
|