chore: Optimize Dockerfile for improved build performance and update Gitea workflows with Docker Buildx support
Publish Tabler Docker image / build-and-push-tabler (push) Has been cancelled
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 5m52s

This commit is contained in:
2025-07-08 23:44:11 +07:00
parent 68d7d55c8b
commit 97711f26cb
7 changed files with 310 additions and 11 deletions
+45
View File
@@ -0,0 +1,45 @@
# Stage 1: Build React frontend
FROM node:20-alpine AS frontend-builder
WORKDIR /app/frontend
# Install yarn for faster package management
RUN npm install -g yarn
# Copy package files
COPY frontend/package*.json ./
COPY frontend/yarn.lock* ./
# Install dependencies with yarn (faster than npm)
RUN yarn install --frozen-lockfile --network-timeout 300000
# Copy source code
COPY frontend/ .
# Build the application
RUN yarn 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
# Copy package files
COPY backend/package*.json ./
COPY backend/yarn.lock* ./
# Install production dependencies only
RUN yarn install --frozen-lockfile --production --network-timeout 300000
# 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"]