This commit is contained in:
parent
5865d55392
commit
522c09c32c
@ -1,5 +1,4 @@
|
||||
# Stage 1: Builder
|
||||
FROM node:20-alpine3.17 AS builder
|
||||
FROM node:20-alpine3.17
|
||||
|
||||
# Install pnpm globally
|
||||
RUN npm install -g pnpm
|
||||
@ -13,23 +12,11 @@ COPY common ./common
|
||||
COPY backend ./backend
|
||||
|
||||
# Install dependencies for all workspaces, including backend
|
||||
RUN pnpm install
|
||||
RUN pnpm install --filter backend...
|
||||
|
||||
# Build the backend
|
||||
RUN pnpm --filter backend build
|
||||
|
||||
# Stage 2: Runner
|
||||
FROM node:20-alpine3.17 AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
COPY --from=builder /app/backend/dist ./dist
|
||||
COPY --from=builder /app/backend/package.json ./backend/package.json
|
||||
|
||||
# Install production dependencies
|
||||
RUN npm install -g pnpm && pnpm install --prod
|
||||
|
||||
# Expose the port your application runs on
|
||||
EXPOSE 8080
|
||||
|
||||
|
Reference in New Issue
Block a user