Files
osirose-new/frontend/Dockerfile
raven 754522b080 - update: Dockerfile layer reordering to speed up build times and lower image space needed
- add: .dockerignore file to reduce file transfers and remove unneeded files in image
2024-12-21 13:10:37 -05:00

25 lines
495 B
Docker

# Step 1: Build the React app
FROM node:22-alpine AS build
# Set working directory
WORKDIR /app
# Copy package.json and install dependencies
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Step 2: Serve the React app using nginx
FROM nginx:alpine
# Copy the built React files to the nginx html folder
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]