Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Dockerfile.auth
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ FROM node:22-alpine AS builder

WORKDIR /auth-builder

COPY ./package.json ./
# Copy package manifests first for better layer caching
COPY ./package.json ./package-lock.json ./
COPY ./apps/auth/package.json ./apps/auth/
COPY ./shared/database/package.json ./shared/database/
COPY ./shared/authentication/package.json ./shared/authentication/

RUN npm ci

# Copy source code and build (this layer invalidates on code changes)
COPY ./tsconfig.base.json ./
COPY ./shared ./shared
COPY ./apps/auth ./apps/auth

RUN npm install && npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/auth-service
RUN npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/auth-service

#Production stage
FROM node:22-alpine AS prod
Expand Down
12 changes: 10 additions & 2 deletions Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ FROM node:22-alpine AS builder

WORKDIR /builder

COPY ./package.json ./
# Copy package manifests first for better layer caching
COPY ./package.json ./package-lock.json ./
COPY ./apps/backend/package.json ./apps/backend/
COPY ./shared/database/package.json ./shared/database/
COPY ./shared/authentication/package.json ./shared/authentication/

RUN npm ci

# Copy source code and build (this layer invalidates on code changes)
COPY ./tsconfig.base.json ./
COPY ./shared ./shared
COPY ./apps/backend ./apps/backend

RUN npm install && npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/backend
RUN npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/backend

#Production stage
FROM node:22-alpine AS prod
Expand Down