Files
homelab/apps/api/Dockerfile
Julia McGhee a525fc8aec
All checks were successful
CI / lint-and-test (push) Successful in 18s
CI / build (push) Successful in 2m11s
chore: trigger full rebuild (7)
2026-03-21 18:13:19 +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 7