Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS builder
COPY --from=install /temp/dev/node_modules node_modules
COPY service/src ./src
COPY service/scripts ./scripts
COPY shared /shared
COPY service/tsconfig.json ./
RUN bun build ./src/file-server.ts --minify --outdir .build --target bun --external '@opentelemetry/*'
RUN bun build ./src/api-server.ts --minify --outdir .build-api --target bun --external '@opentelemetry/*'
RUN bun build ./scripts/rehydrate-session-cache.ts --minify --outdir .build-migrations --target bun --external '@opentelemetry/*'
RUN bun build ./src/worker-server.ts --minify --outdir .build-worker --target bun --external '@opentelemetry/*'
RUN bun build ./src/egress-gateway.ts --minify --outdir .build-egress-gateway --target bun --external '@opentelemetry/*'

Expand All @@ -37,6 +39,7 @@ ENV NODE_ENV=production
WORKDIR /app
COPY --from=install /temp/prod/node_modules ./node_modules
COPY --from=builder /app/.build-api ./.build-api
COPY --from=builder /app/.build-migrations ./.build-migrations
COPY --from=builder /app/src/*.py ./src/
CMD ["bun", "run", ".build-api/api-server.js"]

Expand Down
3 changes: 3 additions & 0 deletions service/Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS builder
COPY --from=install /temp/dev/node_modules node_modules
COPY service/src ./src
COPY service/scripts ./scripts
COPY shared /shared
COPY service/tsconfig.json ./
RUN bun build ./src/api-server.ts --minify --outdir .build --target bun --external '@opentelemetry/*'
RUN bun build ./scripts/rehydrate-session-cache.ts --minify --outdir .build-migrations --target bun --external '@opentelemetry/*'

# Production stage
FROM oven/bun:1.3.14 AS production
Expand All @@ -30,6 +32,7 @@ WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
COPY --from=install /temp/prod/node_modules ./node_modules
COPY --from=builder /app/.build ./.build
COPY --from=builder /app/.build-migrations ./.build-migrations
COPY --from=builder /app/src ./src
# Copy matplotlib templates to /app where __dirname points at runtime
COPY --from=builder /app/src/matplotlib.py /app/src/matplotlib-async.py ./
Expand Down
Loading