rahul20006 commited on
Commit
205e6ad
·
verified ·
1 Parent(s): 0e32d5f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -1,26 +1,28 @@
1
  # Use Node.js 22 (Official Image)
2
  FROM node:22-bullseye
3
 
4
- # 1. Install utilities & Ollama manually to avoid build errors
 
5
  RUN apt-get update && apt-get install -y curl git sudo \
6
  && curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama \
7
  && chmod +x /usr/bin/ollama
8
 
9
- # 2. Install VS Code Server (The Interface)
10
  RUN curl -fsSL https://code-server.dev/install.sh | sh
11
 
12
- # 3. Permission Fix: Allow 'node' user to use sudo
 
 
 
 
13
  RUN echo "node ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/node \
14
  && chmod 0440 /etc/sudoers.d/node
15
 
16
- # 4. Switch to the existing user 'node'
17
  USER node
18
  ENV HOME=/home/node
19
  WORKDIR $HOME
20
 
21
- # 5. Install Clawdbot
22
- RUN npm install -g clawdbot
23
-
24
  # 6. SECURITY: Set your VS Code Password here!
25
  # CHANGE 'mypassword123' to something unique
26
  ENV PASSWORD=mypassword123
@@ -29,5 +31,6 @@ ENV PASSWORD=mypassword123
29
  EXPOSE 7860
30
 
31
  # 8. Start Command: Runs Ollama in background + VS Code in foreground
 
32
  CMD ollama serve > /tmp/ollama.log 2>&1 & \
33
  code-server --bind-addr 0.0.0.0:7860 --auth password
 
1
  # Use Node.js 22 (Official Image)
2
  FROM node:22-bullseye
3
 
4
+ # 1. Install utilities & Ollama
5
+ # We download the binary directly to avoid installer script issues
6
  RUN apt-get update && apt-get install -y curl git sudo \
7
  && curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama \
8
  && chmod +x /usr/bin/ollama
9
 
10
+ # 2. Install VS Code Server
11
  RUN curl -fsSL https://code-server.dev/install.sh | sh
12
 
13
+ # 3. Install Clawdbot (MOVED UP - Runs as root now)
14
+ # We do this BEFORE switching users so we have permission to write to the system folders
15
+ RUN npm install -g clawdbot
16
+
17
+ # 4. Permission Fix: Allow 'node' user to use sudo
18
  RUN echo "node ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/node \
19
  && chmod 0440 /etc/sudoers.d/node
20
 
21
+ # 5. Switch to the existing user 'node'
22
  USER node
23
  ENV HOME=/home/node
24
  WORKDIR $HOME
25
 
 
 
 
26
  # 6. SECURITY: Set your VS Code Password here!
27
  # CHANGE 'mypassword123' to something unique
28
  ENV PASSWORD=mypassword123
 
31
  EXPOSE 7860
32
 
33
  # 8. Start Command: Runs Ollama in background + VS Code in foreground
34
+ # We use /tmp/ollama.log so the non-root user can write to it
35
  CMD ollama serve > /tmp/ollama.log 2>&1 & \
36
  code-server --bind-addr 0.0.0.0:7860 --auth password