mirror of
https://github.com/runyanjake/jakesphotos.git
synced 2025-10-04 15:37:30 -07:00
29 lines
569 B
Docker
29 lines
569 B
Docker
# Use the official Node.js image as a build stage
|
|
FROM node:14 AS build
|
|
|
|
# Set the working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package.json and package-lock.json
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Build the React application
|
|
RUN npm run build
|
|
|
|
# Use a lightweight web server to serve the build files
|
|
FROM nginx:alpine
|
|
|
|
# Copy the build files from the previous stage
|
|
COPY --from=build /app/build /usr/share/nginx/html
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start Nginx
|
|
CMD ["nginx", "-g", "daemon off;"] |