enh
This commit is contained in:
parent
f2763b0597
commit
0c84808637
1 changed files with 6 additions and 4 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -8,7 +8,7 @@ WORKDIR /app
|
||||||
FROM base AS pruner
|
FROM base AS pruner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Copy config files first for better caching
|
# Copy config files first for better caching
|
||||||
COPY package.json bun.lock turbo.json ./
|
COPY package.json turbo.json ./
|
||||||
COPY apps/backend/package.json ./apps/backend/
|
COPY apps/backend/package.json ./apps/backend/
|
||||||
COPY apps/fallback-ui/package.json ./apps/fallback-ui/
|
COPY apps/fallback-ui/package.json ./apps/fallback-ui/
|
||||||
COPY packages/shared/ ./packages/shared
|
COPY packages/shared/ ./packages/shared
|
||||||
|
|
@ -16,19 +16,21 @@ COPY packages/ui/package.json ./packages/ui/
|
||||||
RUN bun install -g turbo
|
RUN bun install -g turbo
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN turbo prune --scope=backend --scope=fallback-ui --scope=common-ui --scope=@packages/shared --docker
|
RUN turbo prune --scope=backend --scope=fallback-ui --scope=common-ui --scope=@packages/shared --docker
|
||||||
|
RUN find . -path "./node_modules" -prune -o -print
|
||||||
|
|
||||||
# 3. ---- Builder ----
|
# 3. ---- Builder ----
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Copy package files first to cache bun install
|
# Copy package files first to cache bun install
|
||||||
COPY --from=pruner /app/out/json/ .
|
COPY --from=pruner /app/out/json/ .
|
||||||
COPY --from=pruner /app/out/bun.lock ./bun.lock
|
#COPY --from=pruner /app/out/bun.lock ./bun.lock
|
||||||
RUN cat ./bun.lock
|
#RUN cat ./bun.lock
|
||||||
COPY --from=pruner /app/turbo.json .
|
COPY --from=pruner /app/turbo.json .
|
||||||
RUN bun install
|
RUN bun install
|
||||||
# Copy source code after dependencies are installed
|
# Copy source code after dependencies are installed
|
||||||
COPY --from=pruner /app/out/full/ .
|
COPY --from=pruner /app/out/full/ .
|
||||||
RUN bunx turbo run build --filter=fallback-ui... --filter=backend...
|
RUN bunx turbo run build --filter=fallback-ui... --filter=backend...
|
||||||
|
RUN find . -path "./node_modules" -prune -o -print
|
||||||
|
|
||||||
# 4. ---- Runner ----
|
# 4. ---- Runner ----
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
|
|
@ -36,7 +38,7 @@ WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
# Copy package files and install production deps
|
# Copy package files and install production deps
|
||||||
COPY --from=pruner /app/out/json/ .
|
COPY --from=pruner /app/out/json/ .
|
||||||
COPY --from=pruner /app/out/bun.lock ./bun.lock
|
#COPY --from=pruner /app/out/bun.lock ./bun.lock
|
||||||
RUN bun install --production
|
RUN bun install --production
|
||||||
# Copy built applications
|
# Copy built applications
|
||||||
COPY --from=builder /app/apps/backend/dist ./apps/backend/dist
|
COPY --from=builder /app/apps/backend/dist ./apps/backend/dist
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue