puffinOffsetCalculator/Dockerfile

29 lines
492 B
Docker
Raw Permalink Normal View History

2025-04-25 01:09:44 +02:00
FROM node:16-alpine as build
# Set working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm install
# Copy source code
COPY . .
# Build the React app
RUN npm run build
# Production stage with Nginx
FROM nginx:alpine
# Copy built app from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]