feat: Update Docker configuration and enhance AutoUrlManager with copy functionality for example format
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 4m32s
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 4m32s
This commit is contained in:
+12
-15
@@ -1,3 +1,4 @@
|
||||
# syntax=docker/dockerfile:1.6
|
||||
# Stage 1: Build React frontend
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
WORKDIR /app/frontend
|
||||
@@ -5,19 +6,17 @@ WORKDIR /app/frontend
|
||||
# Install build dependencies for native modules
|
||||
RUN apk add --no-cache python3 make g++
|
||||
|
||||
# Set npm config for better performance and caching
|
||||
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
|
||||
RUN npm config set cache /tmp/.npm
|
||||
# Set npm config for better performance
|
||||
RUN npm config set registry https://registry.npmjs.org/ \
|
||||
&& npm config set fetch-timeout 300000 \
|
||||
&& npm config set fetch-retry-mintimeout 20000 \
|
||||
&& npm config set fetch-retry-maxtimeout 120000
|
||||
|
||||
# Copy package files first for better caching
|
||||
COPY frontend/package*.json ./
|
||||
|
||||
# Clean install dependencies to fix rollup issue with optimized flags
|
||||
RUN rm -rf node_modules package-lock.json
|
||||
RUN npm install --no-audit --no-fund --prefer-offline --build-from-source --production=false --cache /tmp/.npm
|
||||
# Clean install dependencies with lockfile for reproducible and cached builds
|
||||
RUN --mount=type=cache,target=/root/.npm npm ci --no-audit --no-fund
|
||||
|
||||
# Copy source code (only what's needed for build)
|
||||
COPY frontend/src/ ./src/
|
||||
@@ -33,20 +32,18 @@ RUN npm run build
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# Set npm config for better performance and caching
|
||||
RUN npm config set registry https://registry.npmjs.org/
|
||||
RUN npm config set fetch-timeout 300000
|
||||
RUN npm config set cache /tmp/.npm
|
||||
# Set npm config for better performance
|
||||
RUN npm config set registry https://registry.npmjs.org/ \
|
||||
&& npm config set fetch-timeout 300000
|
||||
|
||||
# Copy package files first for better caching
|
||||
COPY backend/package*.json ./
|
||||
|
||||
# Install production dependencies only with optimized flags
|
||||
RUN npm ci --only=production --no-audit --no-fund --prefer-offline --cache /tmp/.npm
|
||||
RUN --mount=type=cache,target=/root/.npm npm ci --only=production --no-audit --no-fund
|
||||
|
||||
# Copy backend source code (only what's needed)
|
||||
COPY backend/server.js ./
|
||||
COPY backend/package.json ./
|
||||
|
||||
# Copy built frontend assets from the previous stage
|
||||
COPY --from=frontend-builder /app/frontend/dist ./public
|
||||
|
||||
Reference in New Issue
Block a user