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
restaurant/README.md
Normal file
60
restaurant/README.md
Normal file
|
@ -0,0 +1,60 @@
|
|||
# Restaurant Project
|
||||
|
||||
## Description
|
||||
|
||||
This project is a multi-page web application for a restaurant. It utilizes HTML, CSS, and JavaScript to create a dynamic and interactive user experience. The application features several pages including a menu, contact and a home page.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Follow these instructions to get the project up and running on your local machine.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Web Browser (Chrome, Firefox, Safari, etc.)
|
||||
- Text editor or IDE (VSCode, Sublime Text, Atom, etc.)
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Clone the Repository**
|
||||
```
|
||||
bash
|
||||
git clone [repository URL]
|
||||
cd restaurant
|
||||
|
||||
```
|
||||
2. **Install Dependencies**
|
||||
```
|
||||
bash
|
||||
cd app
|
||||
npm install
|
||||
```
|
||||
### Build
|
||||
|
||||
To build the application:
|
||||
```
|
||||
bash
|
||||
npm run build
|
||||
```
|
||||
### Running Locally
|
||||
|
||||
To run the application:
|
||||
```
|
||||
bash
|
||||
npm start
|
||||
```
|
||||
This command will bundle the application with webpack and serve the file to your browser at `http://localhost:8080`.
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `index.html`: The main HTML file.
|
||||
- `src/`: Contains the JavaScript, CSS, and asset files.
|
||||
- `src/index.js`: The main javascript file.
|
||||
- `dist/`: Contains the bundle.js file.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please read the contributing guidelines before getting started.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the LICENSE.md file for details.
|
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;"]
|
32
restaurant/devops/deployment.yaml
Normal file
32
restaurant/devops/deployment.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: restaurant-deployment
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: restaurant
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: restaurant
|
||||
spec:
|
||||
containers:
|
||||
- name: restaurant
|
||||
image: ghcr.io/smiggiddy/odin-codeprojects/restaurant:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: restaurant-service
|
||||
spec:
|
||||
selector:
|
||||
app: restaurant
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
Loading…
Add table
Add a link
Reference in a new issue