Files
homelab/apps/api/Dockerfile
Julia McGhee 8ceea37976
Some checks failed
CI / changes (push) Successful in 16s
CI / lint-and-test (push) Successful in 43s
CI / build (push) Failing after 19s
chore: trigger full rebuild of all app images
2026-03-21 17:27:06 +00:00

27 lines
567 B
Docker

FROM node:20-alpine AS base
FROM base AS deps
WORKDIR /app
COPY package.json ./
RUN npm install
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 appuser
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
USER appuser
EXPOSE 4000
ENV PORT=4000
CMD ["node", "dist/index.js"]
# trigger rebuild 2