File size: 977 Bytes
d2fa4bc
 
14d5c1d
d2fa4bc
 
 
 
14d5c1d
d2fa4bc
 
14d5c1d
d2fa4bc
205e6ad
 
d2fa4bc
 
 
 
 
 
 
94d7d8b
 
d2fa4bc
 
 
 
 
94d7d8b
d2fa4bc
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use Node.js 22 (Official Image)
FROM node:22-bullseye

# 1. Install utilities & Ollama
# Added 'zstd' to fix the "extraction failed" error you saw earlier
RUN apt-get update && apt-get install -y curl git sudo zstd \
    && curl -fsSL https://ollama.com/install.sh | sh

# 2. Install VS Code Server
RUN curl -fsSL https://code-server.dev/install.sh | sh

# 3. Install Clawdbot (Run as root)
RUN npm install -g clawdbot

# 4. Permission Fix: Allow 'node' user to use sudo
RUN echo "node ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/node \
    && chmod 0440 /etc/sudoers.d/node

# 5. Switch to the existing user 'node'
USER node
ENV HOME=/home/node
WORKDIR $HOME

# 6. SECURITY: Set your VS Code Password
# Change this to something only you know
ENV PASSWORD=mypassword123

# 7. Expose Port
EXPOSE 7860

# 8. Start Command
# We use a single line to ensure both services stay alive
CMD ollama serve > /tmp/ollama.log 2>&1 & \
    code-server --bind-addr 0.0.0.0:7860 --auth password