mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 04:45:36 -04:00
adding devops
used gemini to create the k8s/dockerfiles faster
This commit is contained in:
parent
5c09c5a22f
commit
6c14a968c3
74 changed files with 2061 additions and 16 deletions
35
restaurant/devops/Dockerfile
Normal file
35
restaurant/devops/Dockerfile
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Use a Node.js base image to build the project
|
||||
FROM node:18-alpine AS builder
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and package-lock.json (if present)
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the application using webpack
|
||||
RUN npm run build -- --config app/webpack.config.js
|
||||
|
||||
# Use an Nginx base image to serve the static files
|
||||
FROM nginx:alpine
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
# Remove default nginx static files
|
||||
RUN rm -rf ./*
|
||||
|
||||
# Copy the built files from the builder stage
|
||||
COPY --from=builder /app/dist .
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start Nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
Loading…
Add table
Add a link
Reference in a new issue