feat: make flat-stack-presejpacky standalone with Docker and Makefile

This commit is contained in:
2026-06-07 16:48:15 +02:00
parent 164230356c
commit b7e4bbb49d
21 changed files with 5110 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
# Stage 1: Build stage
FROM node:24-alpine AS builder
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm ci
# Copy the rest of the application files
COPY . .
# Build frontend and server.ts
RUN npm run build
# Stage 2: Production stage
FROM node:24-alpine AS runner
WORKDIR /app
# Set production environment
ENV NODE_ENV=production
ENV PORT=3000
# Copy package files and install only production dependencies
COPY package*.json ./
RUN npm ci --only=production
# Copy built assets and compiled server from builder stage
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/server.js ./server.js
# Expose port
EXPOSE 3000
# Run the server
CMD ["node", "server.js"]