Files
router-lists-ui/Dockerfile.fast
T
denozord 97711f26cb
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
chore: Optimize Dockerfile for improved build performance and update Gitea workflows with Docker Buildx support
2025-07-08 23:44:11 +07:00

45 lines
1.0 KiB
Docker

# 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"]