This commit is contained in:
2026-03-18 16:06:29 +07:00
parent fa98e42349
commit ab3d27a4f1
6 changed files with 436 additions and 20 deletions

View File

@@ -6,22 +6,22 @@ WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies with production flag
RUN npm ci --only=production && npm ci
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Build production bundle with optimizations
RUN NODE_ENV=production npm run build 2>/dev/null || true
RUN NODE_ENV=production npm run build
# Production stage - optimize serving
# Production stage - minimal footprint
FROM node:18-alpine
WORKDIR /app
# Install serve with gzip compression support
RUN npm install -g serve
# Install serve for static file serving
RUN npm install -g serve@14
# Copy built app from builder
COPY --from=builder /app/build ./build
@@ -32,5 +32,5 @@ EXPOSE 3000
HEALTHCHECK --interval=10s --timeout=5s --retries=5 \
CMD wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1
# Start server with compression and caching headers
# Start server with gzip compression
CMD ["serve", "-s", "build", "-l", "3000", "--gzip"]