webstack-author/Dockerfile
Daniel Heße a69b81e3d7
Some checks failed
CI / ci (push) Has been cancelled
Added CI/CD workflow
2026-08-21 13:12:53 +02:00

38 lines
746 B
Docker

# Build Stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy dependency manifests
COPY package*.json ./
# Install exactly the dependency versions recorded in package-lock.json
RUN npm ci
# Copy full application codebase
COPY . .
# Compile frontend and bundle backend files
RUN npm run build
# Production alpine stage
FROM node:20-alpine
WORKDIR /app
# Copy configuration files
COPY package*.json ./
# Install exactly the locked production dependencies
RUN npm ci --omit=dev
# Copy compiled build resources from builder stage
COPY --from=builder /app/dist ./dist
# Expose port (Internal container routing to 3000)
EXPOSE 3000
ENV NODE_ENV=production
# Execute standalone node production entrypoint
CMD ["node", "dist/server.cjs"]