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,5 +1,15 @@
|
|||
# webpack-template
|
||||
# Weather Project
|
||||
|
||||
Vanilla template for webpack
|
||||
This project is a web application that allows you to search for weather information for different locations. It is built using HTML, CSS, and JavaScript.
|
||||
|
||||
## Features
|
||||
|
||||
* Search for weather by city name.
|
||||
* Displays current weather conditions.
|
||||
|
||||
## Local Development
|
||||
|
||||
To run this project locally, follow these steps:
|
||||
|
||||
1. **Clone the repository:**
|
||||
|
||||
sets up common utilities needed for vanilla JS/HTML/CSS development
|
||||
|
|
35
weather/devops/Dockerfile
Normal file
35
weather/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 (or yarn.lock)
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the project using webpack
|
||||
RUN npm run build
|
||||
|
||||
# Use an official nginx image as the base image
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Remove default nginx content
|
||||
RUN rm -rf ./*
|
||||
|
||||
# Copy the built files from the builder stage to nginx's html directory
|
||||
COPY --from=builder /app/dist .
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
32
weather/devops/deployment.yaml
Normal file
32
weather/devops/deployment.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: weather-deployment
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: weather
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: weather
|
||||
spec:
|
||||
containers:
|
||||
- name: weather
|
||||
image: ghcr.io/smiggiddy/odin-codeprojects/weather:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: weather-service
|
||||
spec:
|
||||
selector:
|
||||
app: weather
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
type: LoadBalancer
|
Loading…
Add table
Add a link
Reference in a new issue