Files
Cibello-app/infrastructure/docker/Dockerfile.api
T
2026-08-05 19:21:11 +07:00

25 lines
865 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Food API multi-stage build (spec §5051)
FROM node:22-alpine AS builder
WORKDIR /build
RUN corepack enable
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml .npmrc ./
COPY tsconfig.base.json turbo.json ./
COPY packages ./packages
COPY apps/api ./apps/api
RUN pnpm install --frozen-lockfile --filter @app/api...
RUN pnpm --filter @app/api build
FROM node:22-alpine AS runtime
RUN addgroup -S app && adduser -S app -G app
WORKDIR /app
ENV NODE_ENV=production
# tsup bundlar workspace-paketen; externa deps installeras separat
COPY --from=builder /build/apps/api/dist ./dist
COPY --from=builder /build/apps/api/package.json ./package.json
COPY --from=builder /build/node_modules ./node_modules
USER app
EXPOSE 4000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD wget -qO- http://127.0.0.1:4000/healthz || exit 1
CMD ["node", "dist/index.js"]