From 94d1cea488456ff590806c3e20a56c11abd3aaec Mon Sep 17 00:00:00 2001 From: Acbox Date: Sat, 14 Feb 2026 20:39:49 +0800 Subject: [PATCH] fix(docker): Dockerfile.agent --- docker/Dockerfile.agent | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile.agent b/docker/Dockerfile.agent index da4c4cef..3a2a5376 100644 --- a/docker/Dockerfile.agent +++ b/docker/Dockerfile.agent @@ -2,13 +2,20 @@ FROM oven/bun:1 AS builder WORKDIR /build -COPY agent/package.json agent/bun.lock* ./ +# Set up workspace structure so bun can resolve @memoh/config +COPY agent/package.json agent/bun.lock* ./agent/ +COPY packages/config/package.json ./packages/config/package.json -RUN bun install +# Create root package.json with workspace config +RUN echo '{"name":"@memoh/monorepo","private":true,"workspaces":["agent","packages/*"]}' > package.json -COPY agent/ ./ +RUN cd agent && bun install -RUN bun run build --external jsdom +# Copy source files +COPY packages/config/ ./packages/config/ +COPY agent/ ./agent/ + +RUN cd agent && bun run build --external jsdom FROM oven/bun:1-alpine @@ -16,9 +23,9 @@ WORKDIR /app RUN apk add --no-cache ca-certificates wget -COPY --from=builder /build/dist /app/dist -COPY --from=builder /build/node_modules /app/node_modules -COPY --from=builder /build/package.json /app/package.json +COPY --from=builder /build/agent/dist /app/dist +COPY --from=builder /build/agent/node_modules /app/node_modules +COPY --from=builder /build/agent/package.json /app/package.json EXPOSE 8081