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
60
todo/README.md
Normal file
60
todo/README.md
Normal file
|
@ -0,0 +1,60 @@
|
|||
# Todo Project
|
||||
|
||||
This is a web application that allows you to create and manage a todo list.
|
||||
|
||||
## Description
|
||||
|
||||
This project allows you to create, edit, and delete tasks from a todo list. The project utilizes Javascript, HTML, and CSS.
|
||||
|
||||
## Features
|
||||
|
||||
* Add new tasks to the todo list.
|
||||
* Mark tasks as complete.
|
||||
* Delete tasks from the todo list.
|
||||
|
||||
## Local Development
|
||||
|
||||
To run this project locally, follow these steps:
|
||||
|
||||
1. **Clone the repository:**
|
||||
```
|
||||
bash
|
||||
git clone <repository_url>
|
||||
|
||||
```
|
||||
2. **Navigate to the project directory:**
|
||||
```
|
||||
bash
|
||||
cd todo
|
||||
|
||||
```
|
||||
3. **Open `index.html`:** Open the `index.html` file in your web browser.
|
||||
|
||||
## Build
|
||||
|
||||
The build of this project is handled through webpack.
|
||||
|
||||
1. **Install Dependencies:**
|
||||
```
|
||||
bash
|
||||
npm install
|
||||
|
||||
```
|
||||
2. **Run Build:**
|
||||
```
|
||||
bash
|
||||
npm run build
|
||||
|
||||
```
|
||||
After running build, a `bundle.js` will be generated.
|
||||
|
||||
## Usage
|
||||
|
||||
Once you have the project running, you can use the interface in your browser to interact with the todo list.
|
||||
|
||||
## Technologies Used
|
||||
|
||||
* HTML
|
||||
* CSS
|
||||
* JavaScript
|
||||
* webpack
|
38
todo/devops/Dockerfile
Normal file
38
todo/devops/Dockerfile
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Use an official Node.js runtime as the base image
|
||||
FROM node:18-alpine as builder
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and package-lock.json to the working directory
|
||||
COPY package*.json ./
|
||||
|
||||
# Install any needed dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
# Use an official Nginx runtime as the base image
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
# Remove default nginx static files
|
||||
RUN rm -rf ./*
|
||||
|
||||
# Copy static files from the builder stage
|
||||
COPY --from=builder /app/dist .
|
||||
|
||||
# Copy the nginx configuration file
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Command to run when starting the container
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
32
todo/devops/deployment.yaml
Normal file
32
todo/devops/deployment.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: todo-deployment
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: todo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: todo
|
||||
spec:
|
||||
containers:
|
||||
- name: todo
|
||||
image: ghcr.io/smiggiddy/odin-codeprojects/todo:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: todo-service
|
||||
spec:
|
||||
selector:
|
||||
app: todo
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
type: LoadBalancer
|
Loading…
Add table
Add a link
Reference in a new issue