(feat): Dockerfile

This commit is contained in:
Blake Ridgway 2024-12-28 12:01:49 -06:00
parent 769b7ffdae
commit 33e004ecb5

30
Dockerfile Normal file
View file

@ -0,0 +1,30 @@
# Use an official Node.js runtime as a parent image
FROM node:18-alpine AS build
# Set the working directory in the container
WORKDIR /app
# Copy only package.json and package-lock.json to avoid unnecessary rebuilds
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code to the container
COPY . .
# Build the Vue.js app for production
RUN npm run build
# Use a lightweight web server to serve the app
FROM nginx:1.25-alpine
# Copy the built files to the Nginx web server's directory
COPY --from=build /app/dist /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]