Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +26 -38
Dockerfile
CHANGED
|
@@ -1,46 +1,34 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
# 1. Install
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
xfce4 xfce4-terminal \
|
| 8 |
-
tigervnc-standalone-server novnc python3-websockify python3-numpy \
|
| 9 |
-
curl git sudo zstd dbus-x11 \
|
| 10 |
-
&& apt-get clean
|
| 11 |
|
| 12 |
-
# 2. Install
|
| 13 |
-
RUN curl -fsSL https://
|
| 14 |
-
&& apt-get install -y nodejs
|
| 15 |
|
| 16 |
-
# 3. Install
|
| 17 |
-
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 18 |
-
|
| 19 |
-
# 4. Install Clawdbot (Global Install)
|
| 20 |
RUN npm install -g clawdbot
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
RUN
|
| 24 |
-
&&
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
WORKDIR $HOME
|
| 28 |
|
| 29 |
-
# 6.
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
# 7. Create Startup Script
|
| 35 |
-
# This starts the Desktop (XFCE), VNC Server, and Ollama all at once
|
| 36 |
-
RUN echo '#!/bin/bash\n\
|
| 37 |
-
export USER=user\n\
|
| 38 |
-
rm -rf /tmp/.X1-lock /tmp/.X11-unix\n\
|
| 39 |
-
ollama serve > /tmp/ollama.log 2>&1 &\n\
|
| 40 |
-
vncserver :1 -geometry 1280x720 -depth 24 -localhost no\n\
|
| 41 |
-
/usr/share/novnc/utils/launch.sh --vnc localhost:5901 --listen 7860\n\
|
| 42 |
-
' > $HOME/start.sh && chmod +x $HOME/start.sh
|
| 43 |
-
|
| 44 |
-
# 8. Expose Port & Start
|
| 45 |
EXPOSE 7860
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Node.js 22 (Official Image)
|
| 2 |
+
FROM node:22-bullseye
|
| 3 |
|
| 4 |
+
# 1. Install utilities & Ollama
|
| 5 |
+
# Added 'zstd' to fix the "extraction failed" error you saw earlier
|
| 6 |
+
RUN apt-get update && apt-get install -y curl git sudo zstd \
|
| 7 |
+
&& curl -fsSL https://ollama.com/install.sh | sh
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# 2. Install VS Code Server
|
| 10 |
+
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
|
|
|
| 11 |
|
| 12 |
+
# 3. Install Clawdbot (Run as root)
|
|
|
|
|
|
|
|
|
|
| 13 |
RUN npm install -g clawdbot
|
| 14 |
|
| 15 |
+
# 4. Permission Fix: Allow 'node' user to use sudo
|
| 16 |
+
RUN echo "node ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/node \
|
| 17 |
+
&& chmod 0440 /etc/sudoers.d/node
|
| 18 |
+
|
| 19 |
+
# 5. Switch to the existing user 'node'
|
| 20 |
+
USER node
|
| 21 |
+
ENV HOME=/home/node
|
| 22 |
WORKDIR $HOME
|
| 23 |
|
| 24 |
+
# 6. SECURITY: Set your VS Code Password
|
| 25 |
+
# Change this to something only you know
|
| 26 |
+
ENV PASSWORD=mypassword123
|
| 27 |
+
|
| 28 |
+
# 7. Expose Port
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
EXPOSE 7860
|
| 30 |
+
|
| 31 |
+
# 8. Start Command
|
| 32 |
+
# We use a single line to ensure both services stay alive
|
| 33 |
+
CMD ollama serve > /tmp/ollama.log 2>&1 & \
|
| 34 |
+
code-server --bind-addr 0.0.0.0:7860 --auth password
|