Files
router-lists-ui/Dockerfile.fast
T
denozord b4f1a2858d
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 6m38s
chore: Remove production flag from npm ci in Dockerfile.fast for improved dependency installation
2025-07-09 08:48:56 +07:00

47 lines
1.2 KiB
Docker

# Stage 1: Build React frontend
FROM node:20-alpine AS frontend-builder
WORKDIR /app/frontend
# Set npm config for better performance
RUN npm config set registry https://registry.npmjs.org/
RUN npm config set fetch-timeout 300000
RUN npm config set fetch-retry-mintimeout 20000
RUN npm config set fetch-retry-maxtimeout 120000
# Copy package files first for better caching
COPY frontend/package*.json ./
# Install dependencies with specific flags for speed
RUN npm ci --no-audit --no-fund --prefer-offline
# Copy source code
COPY frontend/ .
# Build the application
RUN npm run build
# Stage 2: Setup Node.js backend and serve everything
FROM node:20-alpine
WORKDIR /app
# Set npm config for better performance
RUN npm config set registry https://registry.npmjs.org/
RUN npm config set fetch-timeout 300000
# Copy package files first for better caching
COPY backend/package*.json ./
# Install production dependencies only
RUN npm ci --only=production --no-audit --no-fund --prefer-offline
# Copy backend source code
COPY backend/ .
# Copy built frontend assets from the previous stage
COPY --from=frontend-builder /app/frontend/dist ./public
# The port the backend runs on
EXPOSE 3001
# Start the server
CMD ["node", "server.js"]