35bc7b6c31
ci / typecheck (map[dir:apps/booking name:booking]) (push) Has been cancelled
ci / typecheck (map[dir:apps/portal name:portal]) (push) Has been cancelled
ci / typecheck (map[dir:apps/website name:website]) (push) Has been cancelled
ci / typecheck (map[dir:services/platform-api name:platform-api]) (push) Has been cancelled
ci / test (push) Has been cancelled
31 lines
918 B
Docker
31 lines
918 B
Docker
# Production image for the dezky platform-api (NestJS, ESM + NodeNext).
|
|
# Build context = this directory (services/platform-api).
|
|
# syntax=docker/dockerfile:1
|
|
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
RUN corepack enable
|
|
# Install deps first for layer caching (pnpm version comes from packageManager).
|
|
COPY package.json pnpm-lock.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
COPY . .
|
|
RUN pnpm build
|
|
|
|
FROM node:22-alpine AS deps
|
|
WORKDIR /app
|
|
RUN corepack enable
|
|
COPY package.json pnpm-lock.yaml ./
|
|
# Production-only deps for the runtime layer (no dev/build tooling).
|
|
RUN pnpm install --frozen-lockfile --prod
|
|
|
|
FROM node:22-alpine AS runtime
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3001
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY --from=build /app/dist ./dist
|
|
COPY package.json ./
|
|
EXPOSE 3001
|
|
# main.ts compiles to dist/main.js; NodeNext ESM output is run directly by node.
|
|
CMD ["node", "dist/main.js"]
|