adding devops

used gemini to create the k8s/dockerfiles faster
This commit is contained in:
Smigz 2025-05-02 16:47:07 +00:00
parent 5c09c5a22f
commit 6c14a968c3
74 changed files with 2061 additions and 16 deletions

24
library/README.md Normal file
View file

@ -0,0 +1,24 @@
# Library Project
## Description
This is a web application that allows users to manage a personal library of books. It's built using HTML, CSS, and JavaScript.
## How to Run Locally
1. **Open `index.html`:** Navigate to the `library` directory in your file explorer and open the `index.html` file in your web browser.
2. **View the Application:** The library application will now be running in your browser. You can interact with the application directly from the browser.
3. **Javascript Logic:** The logic for the application is within the `js/script.js` file.
4. **Styling:** The style for the application is in `css/style.css`
## Project Structure
* `index.html`: The main HTML file for the application.
* `css/`: Directory containing the CSS files.
* `style.css`: CSS file for styling the application.
* `js/`: Directory containing the JavaScript files.
* `script.js`: JavaScript file containing the application logic.
## Additional Notes
* No server or special environment is required to run this application locally. Simply open the `index.html` in your web browser.

20
library/devops/Dockerfile Normal file
View file

@ -0,0 +1,20 @@
# Use an official Nginx image as the base image
FROM nginx:latest
# Remove default Nginx configuration
RUN rm /etc/nginx/conf.d/default.conf
# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d
# Set the working directory in the container
WORKDIR /usr/share/nginx/html
# Copy the project files into the container's directory
COPY . .
# Expose port 80 to the outside world
EXPOSE 80
# Start Nginx when the container starts
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: library-deployment
spec:
replicas: 3
selector:
matchLabels:
app: library
template:
metadata:
labels:
app: library
spec:
containers:
- name: library
image: ghcr.io/smiggiddy/odin-codeprojects/library:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: library-service
spec:
type: LoadBalancer
selector:
app: library
ports:
- protocol: TCP
port: 80
targetPort: 80