Skip to content

Commit 0dd6de5

Browse files
authored
Merge pull request #6 from jihchi/multi-stage-dockerfile
Use multi-stage Docker build
2 parents 8dee4f5 + c0d06f3 commit 0dd6de5

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ and workspace):
123123

124124
```sh
125125
docker run -it --rm \
126-
-v $(which claude):/usr/local/bin/claude \
127126
-v ~/.claude:/home/deno/.claude \
127+
-v ~/.claude.json:/home/deno/.claude.json \
128128
-v ~/.config/muxclaw:/home/deno/.config/muxclaw \
129129
-v $(pwd)/workspace:/workspace \
130130
ghcr.io/jihchi/muxclaw

container/Dockerfile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
FROM denoland/deno:2.6.10
1+
# Build stage
2+
FROM denoland/deno:2.6.10 AS builder
3+
WORKDIR /app
24

35
# Install nq and dependencies for zellij
46
RUN apt-get update \
5-
&& apt-get install -y --no-install-recommends nq curl ca-certificates \
7+
&& apt-get install -y --no-install-recommends \
8+
nq \
9+
curl \
10+
ca-certificates \
611
&& rm -rf /var/lib/apt/lists/*
712

813
# Install zellij
@@ -17,14 +22,16 @@ RUN ARCH=$(dpkg --print-architecture) \
1722
| tar -xz -C /usr/local/bin \
1823
&& chmod +x /usr/local/bin/zellij
1924

25+
# Production stage
26+
FROM denoland/deno:2.6.10
2027
WORKDIR /app
2128

22-
# Cache dependencies
23-
COPY deno.json deno.lock ./
24-
RUN deno install
29+
COPY --from=builder /usr/bin/nq /usr/bin/nqtail /usr/bin/nqterm /usr/bin/
30+
COPY --from=builder /usr/local/bin/zellij /usr/local/bin/
2531

26-
# Copy application source
27-
COPY cli.ts container/layout.kdl ./
32+
# Install dependencies
33+
COPY deno.json deno.lock cli.ts container/layout.kdl .
34+
RUN deno install
2835

2936
# Ensure XDG directories exist
3037
RUN mkdir -p \

0 commit comments

Comments
 (0)