3 Commits

4 changed files with 25 additions and 4 deletions

View File

@@ -13,7 +13,6 @@ pnpm-debug.log*
.env.production.local .env.production.local
# Build outputs # Build outputs
dist
build build
.next .next
out out

View File

@@ -1,3 +1,22 @@
FROM node:22-alpine AS builder
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Install all deps for building server
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
# Copy only server sources and tsconfig for server build
COPY src/server ./src/server
COPY tsconfig.server.json ./tsconfig.server.json
COPY tsconfig.server.build.json ./tsconfig.server.build.json
# Build server only (no client build)
RUN pnpm tsc -p tsconfig.server.build.json
FROM node:22-alpine AS production FROM node:22-alpine AS production
# Install pnpm and required runtime tools # Install pnpm and required runtime tools
@@ -14,7 +33,8 @@ RUN pnpm install --frozen-lockfile --prod
# Copy prebuilt application artifacts from repository (no TS build in image) # Copy prebuilt application artifacts from repository (no TS build in image)
COPY dist ./dist COPY dist ./dist
COPY server-dist ./server-dist # Use freshly built server from builder stage
COPY --from=builder /app/server-dist ./server-dist
COPY public ./public COPY public ./public
# Copy necessary runtime files # Copy necessary runtime files

View File

@@ -7,6 +7,7 @@
"declaration": false, "declaration": false,
"module": "ESNext", "module": "ESNext",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"skipLibCheck": true,
"allowImportingTsExtensions": false, "allowImportingTsExtensions": false,
"target": "ES2022", "target": "ES2022",
"baseUrl": ".", "baseUrl": ".",

View File

@@ -1,10 +1,11 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"module": "NodeNext", "module": "ESNext",
"moduleResolution": "NodeNext", "moduleResolution": "bundler",
"noEmit": true, "noEmit": true,
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"jsx": "react-jsx",
"types": ["node"], "types": ["node"],
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"]