rahul20006 commited on
Commit
d2fa4bc
·
verified ·
1 Parent(s): f756dcc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -38
Dockerfile CHANGED
@@ -1,46 +1,34 @@
1
- FROM debian:bullseye
 
2
 
3
- # 1. Install Desktop Environment (XFCE), VNC, and Utilities
4
- # We include 'zstd' here to fix the Ollama install error
5
- ENV DEBIAN_FRONTEND=noninteractive
6
- RUN apt-get update && apt-get install -y \
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 Node.js 22 (Required for Clawdbot)
13
- RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
14
- && apt-get install -y nodejs
15
 
16
- # 3. Install Ollama
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
- # 5. Setup User 'user' (Required by Hugging Face)
23
- RUN useradd -m -u 1000 user \
24
- && echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user
25
- USER user
26
- ENV HOME=/home/user
 
 
27
  WORKDIR $HOME
28
 
29
- # 6. Configure VNC (Password: mypassword123)
30
- RUN mkdir -p $HOME/.vnc \
31
- && echo "mypassword123" | vncpasswd -f > $HOME/.vnc/passwd \
32
- && chmod 600 $HOME/.vnc/passwd
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
- CMD ["./start.sh"]
 
 
 
 
 
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