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
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 5m40s
This commit is contained in:
+14
-12
@@ -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/ .
|
||||
|
||||
Reference in New Issue
Block a user