add readme and dockers and make this presentable lol
This commit is contained in:
29
frontend/Dockerfile
Normal file
29
frontend/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
# Use an official Node runtime as a parent image
|
||||
FROM node:22.2-alpine as build
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and package-lock.json to the working directory
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code to the working directory
|
||||
COPY . .
|
||||
|
||||
# Build the React app for production
|
||||
RUN npm run build
|
||||
|
||||
# Use nginx as the base image for serving content
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy the build output from the build stage to serve with nginx
|
||||
COPY --from=build /app/build /usr/share/nginx/html
|
||||
|
||||
# Expose port 80 to the Docker network
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx when the container starts
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user