zkt26/Front-end/Dockerfile
2026-03-28 11:30:03 +01:00

26 lines
529 B
Docker

# Stage 1: Build the React application
FROM node:18-alpine AS build
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve the application using Nginx
FROM nginx:alpine
# Remove default Nginx static assets
RUN rm -rf /usr/share/nginx/html/*
# Copy built app from the first stage
COPY --from=build /app/dist /usr/share/nginx/html
# Replace the default Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]