-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (28 loc) · 975 Bytes
/
Dockerfile
File metadata and controls
34 lines (28 loc) · 975 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
28
29
30
31
32
33
34
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Enable corepack just in case, though we use npm
RUN corepack enable
FROM base AS builder
WORKDIR /app
COPY . .
# Install all deps
RUN npm install
# Build everything (turbo will handle order: db -> api, web)
RUN npm run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy necessary files
COPY --from=builder /app/package.json .
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/services ./services
COPY --from=builder /app/tsconfig.base.json .
# Seed the DB (Optional, but good for self-contained demo)
# In production, this would be a separate init container or job
# RUN npm run seed --workspace=@glassbox/db
# Expose port
EXPOSE 3001
# Start API (which serves Web)
CMD sh -c "npm run migrate --workspace=@glassbox/db && npm run seed --workspace=@glassbox/db && npm start --workspace=@glassbox/api"