build(container): use turbo pruned web workspace
This commit is contained in:
parent
220fb55a47
commit
3e46a2c0cc
5 changed files with 58 additions and 37 deletions
|
|
@ -1,19 +1,25 @@
|
|||
FROM docker.io/oven/bun:1.3.14 AS deps
|
||||
FROM docker.io/oven/bun:1.3.14 AS base
|
||||
|
||||
WORKDIR /repo
|
||||
ENV PATH=/repo/apps/web/node_modules/.bin:/repo/packages/ui/node_modules/.bin:/repo/node_modules/.bin:$PATH
|
||||
COPY package.json bun.lock turbo.json tsconfig.base.json ./
|
||||
COPY apps/web/package.json apps/web/package.json
|
||||
COPY packages/dashboard-model/package.json packages/dashboard-model/package.json
|
||||
COPY packages/ui/package.json packages/ui/package.json
|
||||
ENV PATH=/repo/apps/web/node_modules/.bin:/repo/packages/dashboard-model/node_modules/.bin:/repo/packages/ui/node_modules/.bin:/repo/node_modules/.bin:$PATH
|
||||
|
||||
FROM base AS pruner
|
||||
|
||||
COPY . .
|
||||
RUN bunx turbo prune @dimensionlab/web --docker
|
||||
|
||||
FROM base AS deps
|
||||
|
||||
COPY --from=pruner /repo/out/json/ ./
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
FROM deps AS build
|
||||
|
||||
COPY . .
|
||||
RUN bun install --frozen-lockfile && bun run build
|
||||
COPY --from=pruner /repo/out/full/ ./
|
||||
COPY --from=pruner /repo/tsconfig.base.json /repo/tsconfig.json ./
|
||||
RUN bun run build
|
||||
|
||||
FROM deps AS runtime
|
||||
FROM base AS runtime
|
||||
|
||||
WORKDIR /repo/apps/web
|
||||
ENV NODE_ENV=production
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue