File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Multi-stage Dockerfile for React frontend with Python backend support using UV
22
33# Stage 1: Node build environment for React
4- FROM node:20 -alpine AS frontend-builder
4+ FROM node:18 -alpine AS frontend-builder
55
66WORKDIR /app/frontend
77
88# Copy package files first for better caching
99COPY package*.json ./
1010
11- # Copy all source files
11+ # Install dependencies
12+ RUN npm ci --silent
13+
14+ # Copy source files
1215COPY . ./
1316
14- # Install dependencies and build in a single layer to avoid BuildKit overlay issues
15- RUN --mount=type=cache,target=/root/.npm \
16- npm ci && npm run build
17+ RUN rm -rf node_modules && npm ci && npm rebuild esbuild --force
18+
19+ # Build the React app
20+ RUN npm run build
1721
1822# Stage 2: Python build environment with UV
1923FROM python:3.11-slim-bullseye AS python-builder
You can’t perform that action at this time.
0 commit comments