feat: containerize

This commit is contained in:
mike 2024-10-21 12:52:40 -04:00
parent 98651de3fa
commit 7e0d4e5f3b
14 changed files with 956 additions and 127 deletions

29
Dockerfile Normal file
View file

@ -0,0 +1,29 @@
# Use an official Node.js runtime as a parent image
FROM node:18 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 application
RUN npm run build
# Use an official Nginx image to serve the built application
FROM nginx:alpine
# Copy the built application from the previous stage
COPY --from=build /app/dist /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]