Build from tsconfig.build.json

This commit is contained in:
Wayne
2025-08-03 01:13:52 +03:00
parent ffaa9762af
commit 181f4fd46c
2 changed files with 13 additions and 4 deletions

View File

@@ -19,10 +19,8 @@ RUN pnpm install --shamefully-hoist --frozen-lockfile --prod=false
# Copy the rest of the source code
COPY . .
# Build packages in order.
RUN pnpm --filter @open-archiver/types build
RUN pnpm --filter @open-archiver/backend build
RUN pnpm --filter @open-archiver/frontend build
# Build the entire project
RUN pnpm exec tsc --build tsconfig.build.json
# 2. Production Stage: Install only production dependencies and copy built artifacts
FROM node:22-alpine AS production
@@ -37,6 +35,9 @@ COPY packages/backend/package.json ./packages/backend/
COPY packages/frontend/package.json ./packages/frontend/
COPY packages/types/package.json ./packages/types/
# Install production dependencies
# RUN pnpm install --shamefully-hoist --frozen-lockfile --prod=true
# Copy built application from build stage
COPY --from=build /app/packages/backend/dist ./packages/backend/dist
COPY --from=build /app/packages/frontend/build ./packages/frontend/build

8
tsconfig.build.json Normal file
View File

@@ -0,0 +1,8 @@
{
"files": [],
"references": [
{ "path": "packages/types" },
{ "path": "packages/backend" },
{ "path": "packages/frontend" }
]
}