Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 4s
18 lines
526 B
Plaintext
18 lines
526 B
Plaintext
# Stage 1: Build the React application
|
|
FROM node:24-alpine AS build
|
|
WORKDIR /app
|
|
# Copy only package files to leverage Docker layer caching
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
# Copy the rest of the source code and build
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve the app with Nginx
|
|
FROM nginx:stable-alpine
|
|
# Copy built assets from the 'build' stage to Nginx's web root
|
|
# Note: Vite uses 'dist', Create React App uses 'build'
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|