fix(docker): Dockerfile.agent

This commit is contained in:
Acbox
2026-02-14 20:39:49 +08:00
parent ac8f857e27
commit 94d1cea488
+14 -7
View File
@@ -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