refactor: Replace Dockerfile with Dockerfile.fast for faster builds and add Dockerfile.test for testing purposes
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 5m40s

This commit is contained in:
2025-07-08 23:54:18 +07:00
parent 97711f26cb
commit 82f2d62bf8
6 changed files with 21 additions and 2513 deletions
+14 -12
View File
@@ -2,35 +2,37 @@
FROM node:20-alpine AS frontend-builder
WORKDIR /app/frontend
# Install yarn for faster package management
RUN npm install -g yarn
# 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
# Copy package files first for better caching
COPY frontend/package*.json ./
COPY frontend/yarn.lock* ./
# Install dependencies with yarn (faster than npm)
RUN yarn install --frozen-lockfile --network-timeout 300000
# Install dependencies with specific flags for speed
RUN npm ci --only=production --no-audit --no-fund --prefer-offline
# Copy source code
COPY frontend/ .
# Build the application
RUN yarn build
RUN npm run build
# Stage 2: Setup Node.js backend and serve everything
FROM node:20-alpine
WORKDIR /app
# Install yarn for faster package management
RUN npm install -g yarn
# 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
# Copy package files first for better caching
COPY backend/package*.json ./
COPY backend/yarn.lock* ./
# Install production dependencies only
RUN yarn install --frozen-lockfile --production --network-timeout 300000
RUN npm ci --only=production --no-audit --no-fund --prefer-offline
# Copy backend source code
COPY backend/ .