-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (21 loc) · 840 Bytes
/
Dockerfile
File metadata and controls
27 lines (21 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# syntax=docker/dockerfile:1.4
FROM oven/bun:1.3.5 AS builder
WORKDIR /app
# Copy everything for dependency resolution and codegen
COPY . .
# Install with BuildKit cache mount for faster rebuilds
RUN --mount=type=cache,target=/root/.bun/install/cache \
bun install
# Generate graph query builders
RUN bun run --filter=@engram/graph generate
FROM oven/bun:1.3.5-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup -S engram && adduser -S engram -G engram
COPY --from=builder --chown=engram:engram /app/apps/memory ./apps/memory
COPY --from=builder --chown=engram:engram /app/packages ./packages
COPY --from=builder --chown=engram:engram /app/node_modules ./node_modules
COPY --from=builder --chown=engram:engram /app/package.json ./package.json
USER engram
EXPOSE 8080
CMD ["bun", "run", "apps/memory/src/index.ts"]