File size: 1,119 Bytes
73a511a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7c65428
 
73a511a
 
 
 
 
 
 
 
 
4cdc3d4
c1f3695
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
35
36
FROM ubuntu:22.04

# Install basic dependencies
RUN apt-get update && apt-get install -y \
    curl git sudo python3 python3-pip nano \
    && rm -rf /var/lib/apt/lists/*

# Install Node.js (Claude Code requires Node 18+)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs

# Install Claude Code globally
RUN npm install -g @anthropic-ai/claude-code

# Install code-server (VS Code for the browser)
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Setup user workspace (Hugging Face requires user ID 1000)
RUN useradd -m -u 1000 coder \
    && mkdir -p /home/coder/workspace \
    && chown -R coder:coder /home/coder

RUN echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

USER coder
WORKDIR /home/coder/workspace

# Bypass the Claude Code login screen during the image build
RUN echo '{"hasCompletedOnboarding": true}' > /home/coder/.claude.json

# Expose Hugging Face's default port
EXPOSE 7860

# Start VS Code Web IDE on port 7860 (NOTICE THE SPACE AFTER CMD)
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "password", "/home/coder/workspace"]