Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Image to use as a base for the others.
- FROM node:current-alpine3.19 AS base
- # Image to actually build the output.
- FROM base AS builder
- WORKDIR /app
- COPY package.json package-lock.json ./
- RUN npm ci
- COPY . .
- RUN npm run build
- # Image to build the runtime, so that the final output doesn't have the NPM caches.
- FROM base AS runtime-builder
- WORKDIR /app
- COPY package.json package-lock.json ./
- RUN npm ci --omit=dev
- COPY --from=builder /app/target/build /app/target
- # Actual final runtime.
- FROM base AS runtime
- WORKDIR /app
- COPY --from=runtime-builder /app ./
- CMD ["node", "./target/src"]
- ENV NODE_ENV=production
- ENV PORT=8000
- HEALTHCHECK --interval=10s --timeout=5s --start-period=15s \
- CMD wget --no-verbose --tries=1 localhost:$PORT/debug/ping || exit 1%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement