Skip to content

Commit fff4fc6

Browse files
committed
🐳 chore(docker): add just and uv to bot runtime
Install just CLI in the bot image and copy uv binary into runtime so operational commands (including migration runbooks) can be executed directly inside the container.
1 parent 4807eaa commit fff4fc6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ COPY webapp ./webapp
3333
# --- Final Stage ---
3434
FROM python:3.12-slim-bookworm
3535

36+
ARG JUST_VERSION=1.40.0
37+
3638
# Set environment variables
3739
ENV PYTHONUNBUFFERED=1
3840

@@ -53,9 +55,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5355
fonts-dejavu-core \
5456
&& rm -rf /var/lib/apt/lists/*
5557

58+
# Install just CLI for in-container operational runbooks
59+
RUN set -eux; \
60+
arch="$(dpkg --print-architecture)"; \
61+
case "$arch" in \
62+
amd64) just_arch="x86_64-unknown-linux-musl" ;; \
63+
arm64) just_arch="aarch64-unknown-linux-musl" ;; \
64+
*) echo "Unsupported architecture: $arch"; exit 1 ;; \
65+
esac; \
66+
curl -fsSL -o /tmp/just.tar.gz "https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-${just_arch}.tar.gz"; \
67+
tar -xzf /tmp/just.tar.gz -C /tmp just; \
68+
install -m 0755 /tmp/just /usr/local/bin/just; \
69+
rm -f /tmp/just /tmp/just.tar.gz
70+
5671
# Copy installed python packages from builder
5772
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
5873
COPY --from=builder /usr/local/bin /usr/local/bin
74+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
5975

6076
# Copy only runtime application code
6177
COPY bot ./bot

0 commit comments

Comments
 (0)