constellation-analyzer/Dockerfile
Jan-Henrik Bruhn f56f928dcf Initial commit
2025-10-10 11:15:51 +02:00

24 lines
568 B
Docker

# Stage 1: Build the React application
FROM node:20-alpine AS build
WORKDIR /app
# Copy package.json and package-lock.json to leverage Docker cache
COPY package*.json ./
RUN npm install
# Copy the rest of the application source code
COPY . .
RUN npm run build
# Stage 2: Serve the application with Nginx
FROM nginx:1.25-alpine AS production
# Copy the built assets from the build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Expose port 80 for the Nginx server
EXPOSE 80
# Start Nginx when the container launches
CMD ["nginx", "-g", "daemon off;"]