-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (47 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
59 lines (47 loc) · 1.58 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Use Node.js Alpine LTS - much smaller base image
FROM node:lts-alpine
# Install build dependencies and cleanup in single layer
RUN apk add --no-cache \
curl \
vim \
python3 \
py3-pip \
sudo \
bash \
git \
&& rm -rf /var/cache/apk/*
# Create non-root user first
RUN adduser -D -s /bin/bash devusr \
&& addgroup devusr wheel \
&& echo 'devusr ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# uv will be installed later as devusr
# Install Go - multi-platform support for amd64 and arm64
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
GO_ARCH="arm64"; \
else \
GO_ARCH="amd64"; \
fi \
&& curl -LO "https://go.dev/dl/go1.24.7.linux-${GO_ARCH}.tar.gz" \
&& tar -C /usr/local -xzf "go1.24.7.linux-${GO_ARCH}.tar.gz" \
&& rm "go1.24.7.linux-${GO_ARCH}.tar.gz" \
&& ln -sf /usr/local/go/bin/go /usr/bin/go
USER devusr
ENV HOME=/home/devusr
# Install Claude Code and uv as devusr
RUN npm config set prefix '~/.npm-global' \
&& npm install -g @anthropic-ai/claude-code@latest \
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
&& rm -rf /tmp/*
# Switch back to root for remaining installations
USER root
# Set PATH for all tools (using literal paths since HOME expands at runtime)
ENV PATH="/usr/local/go/bin:/home/devusr/.local/bin:/home/devusr/.npm-global/bin:/usr/local/bin:$PATH"
# Set working directory
WORKDIR /devbox
# Switch to non-root user
USER devusr
# Set bash as entrypoint to override Node.js default
ENTRYPOINT ["/bin/bash"]
# Default command
CMD ["-c", "while true; do sleep 1000; done"]