1+ FROM ubuntu:24.04
2+
3+ # Set environment variables
4+ ENV DEBIAN_FRONTEND=noninteractive \
5+ NODE_VERSION=22.x \
6+ CLAUDE_CODE_VERSION=latest \
7+ PATH="/root/.local/bin:$PATH" \
8+ ANTHROPIC_BASE_URL="" \
9+ ANTHROPIC_AUTH_TOKEN="" \
10+ ANTHROPIC_MODEL="" \
11+ ANTHROPIC_SMALL_FAST_MODEL="" \
12+ DOCKER_HUB_NAME="" \
13+ DOCKER_HUB_PASSWD=""
14+
15+ # Update and install base dependencies
16+ RUN apt-get update && apt-get install -y \
17+ curl \
18+ wget \
19+ git \
20+ gnupg \
21+ lsb-release \
22+ software-properties-common \
23+ build-essential \
24+ python3 \
25+ python3-pip \
26+ sudo \
27+ vim \
28+ nano \
29+ unzip \
30+ ca-certificates \
31+ apt-transport-https \
32+ && rm -rf /var/lib/apt/lists/*
33+
34+ # Install Node.js (latest LTS)
35+ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - && \
36+ apt-get install -y nodejs && \
37+ npm install -g npm@latest
38+
39+ # Install PostgreSQL client tools
40+ RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
41+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
42+ apt-get update && \
43+ apt-get install -y postgresql-client-16 && \
44+ rm -rf /var/lib/apt/lists/*
45+
46+ # Install global npm packages including Next.js and shadcn/ui dependencies
47+ RUN npm install -g \
48+ next@latest \
49+ create-next-app \
50+ typescript \
51+ @types/node \
52+ @types/react \
53+ @types/react-dom \
54+ pnpm \
55+ yarn \
56+ vercel \
57+ prisma
58+
59+ # Install shadcn/ui CLI and related tools
60+ RUN npm install -g \
61+ shadcn-ui \
62+ tailwindcss \
63+ autoprefixer \
64+ postcss
65+
66+ # Install Claude Code CLI
67+ RUN curl -fsSL https://console.anthropic.com/install.sh | sh && \
68+ echo 'export PATH="/root/.local/bin:$PATH"' >> ~/.bashrc
69+
70+ # Install Buildah and related container tools for unprivileged operation
71+ RUN apt-get update && \
72+ apt-get install -y \
73+ buildah \
74+ podman \
75+ skopeo \
76+ fuse-overlayfs \
77+ uidmap \
78+ slirp4netns \
79+ crun \
80+ && rm -rf /var/lib/apt/lists/*
81+
82+ # Configure Buildah and Podman for fully unprivileged operation
83+ RUN mkdir -p /etc/containers /home/developer/.config/containers && \
84+ echo '[storage]' > /etc/containers/storage.conf && \
85+ echo 'driver = "vfs"' >> /etc/containers/storage.conf && \
86+ echo 'rootless_storage_path = "/tmp/containers-storage"' >> /etc/containers/storage.conf && \
87+ echo '[storage.options]' >> /etc/containers/storage.conf && \
88+ echo 'mount_program = "/usr/bin/fuse-overlayfs"' >> /etc/containers/storage.conf && \
89+ echo '[engine]' > /etc/containers/containers.conf && \
90+ echo 'cgroup_manager = "cgroupfs"' >> /etc/containers/containers.conf && \
91+ echo 'events_logger = "file"' >> /etc/containers/containers.conf && \
92+ echo '[engine.runtimes]' >> /etc/containers/containers.conf && \
93+ echo 'crun = ["/usr/bin/crun"]' >> /etc/containers/containers.conf
94+
95+ # Set up registries configuration for buildah/podman
96+ RUN echo '[registries.search]' > /etc/containers/registries.conf && \
97+ echo 'registries = ["docker.io", "quay.io"]' >> /etc/containers/registries.conf
98+
99+ # Install additional development tools (NO Docker CLI)
100+ RUN apt-get update && apt-get install -y \
101+ jq \
102+ htop \
103+ tree \
104+ zip \
105+ telnet \
106+ net-tools \
107+ iputils-ping \
108+ dnsutils \
109+ openssh-client \
110+ rsync \
111+ tmux \
112+ screen \
113+ make \
114+ && rm -rf /var/lib/apt/lists/*
115+
116+ # Install GitHub CLI
117+ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
118+ chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
119+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
120+ apt-get update && \
121+ apt-get install -y gh && \
122+ rm -rf /var/lib/apt/lists/*
123+
124+ # Install code editors extensions and tools
125+ RUN apt-get update && apt-get install -y \
126+ ripgrep \
127+ fd-find \
128+ bat \
129+ exa \
130+ && rm -rf /var/lib/apt/lists/*
131+
132+ # Create working directory
133+ WORKDIR /workspace
134+
135+ # Set up a non-root user for better security (optional, can be overridden)
136+ RUN useradd -m -s /bin/bash developer && \
137+ echo 'developer ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
138+
139+ # Expose common ports for web development
140+ EXPOSE 3000 3001 5000 5173 8080 8000 5432
141+
142+ # Set default command
143+ CMD ["/bin/bash" ]
0 commit comments