Skip to content

Commit a5e99d2

Browse files
committed
first commit: Full-stack web runtime Docker image with build tools
0 parents  commit a5e99d2

4 files changed

Lines changed: 590 additions & 0 deletions

File tree

.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Environment variables
2+
.env
3+
.env.local
4+
.env.production
5+
.env.*.local
6+
*.env
7+
8+
# Secrets and credentials
9+
**/secrets
10+
**/credentials
11+
*.key
12+
*.pem
13+
*.crt
14+
*.p12
15+
*.pfx
16+
17+
# Docker Hub credentials
18+
docker-credentials.txt
19+
.docker/config.json
20+
21+
# Build artifacts
22+
*.tar
23+
*.tar.gz
24+
*.tar.bz2
25+
*.tar.xz
26+
*.zip
27+
28+
# Container storage
29+
/tmp/containers-storage/
30+
.local/share/containers/
31+
32+
# IDE and editor files
33+
.vscode/
34+
.idea/
35+
*.swp
36+
*.swo
37+
*~
38+
.DS_Store
39+
40+
# Logs
41+
*.log
42+
npm-debug.log*
43+
yarn-debug.log*
44+
yarn-error.log*
45+
46+
# Runtime data
47+
pids
48+
*.pid
49+
*.seed
50+
*.pid.lock
51+
52+
# Temporary files
53+
*.tmp
54+
tmp/
55+
temp/
56+
57+
# Build directories
58+
build/
59+
dist/
60+
out/
61+
62+
# Node modules (if any local testing)
63+
node_modules/
64+
65+
# Python
66+
__pycache__/
67+
*.py[cod]
68+
*$py.class
69+
*.so
70+
.Python
71+
venv/
72+
ENV/
73+
74+
# Backup files
75+
*.bak
76+
*.backup
77+
*~
78+
79+
# OS files
80+
Thumbs.db
81+
.DS_Store
82+
.AppleDouble
83+
.LSOverride
84+
85+
# Coverage reports
86+
coverage/
87+
*.lcov
88+
.nyc_output/

Dockerfile

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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

Comments
 (0)