mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-27 20:45:35 -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
|
@ -1,8 +1,10 @@
|
|||
# React + Vite
|
||||
# CV Project
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
This project is a web application built using React. It is designed to showcase a digital CV or resume.
|
||||
|
||||
Currently, two official plugins are available:
|
||||
## Local Development
|
||||
|
||||
To run this project locally, follow these steps:
|
||||
|
||||
1. **Clone the repository:**
|
||||
|
||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
||||
|
|
35
cv-project/devops/Dockerfile
Normal file
35
cv-project/devops/Dockerfile
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Use a Node.js image as the base for building the React app
|
||||
FROM node:18-alpine AS builder
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and package-lock.json to install dependencies
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the React app using Vite
|
||||
RUN npm run build
|
||||
|
||||
# Use an official Nginx image to serve the static files
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
# Remove default Nginx static files
|
||||
RUN rm -rf ./*
|
||||
|
||||
# Copy the build output from the builder stage
|
||||
COPY --from=builder /app/dist .
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start Nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
32
cv-project/devops/deployment.yaml
Normal file
32
cv-project/devops/deployment.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: cv-project-deployment
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: cv-project
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: cv-project
|
||||
spec:
|
||||
containers:
|
||||
- name: cv-project
|
||||
image: ghcr.io/smiggiddy/odin-codeprojects/cv-project:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: cv-project-service
|
||||
spec:
|
||||
selector:
|
||||
app: cv-project
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
type: LoadBalancer
|
Loading…
Add table
Add a link
Reference in a new issue