Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
99efbfb
myself
Jithesh0017 Jun 9, 2025
47c0555
done
Jithesh0017 Jun 9, 2025
8ae2f19
Update FrontPage.js 2.1
Jithesh0017 Jun 10, 2025
3fe5743
Update FrontPage.jsworld
Jithesh0017 Jun 10, 2025
310fe2e
Update package.json
Jithesh0017 Jun 10, 2025
99369ce
Update FrontPage.js
Jithesh0017 Jun 10, 2025
07420a8
Update package.json 3.2
Jithesh0017 Jun 10, 2025
539ced0
Update FrontPage.js mafia
Jithesh0017 Jun 13, 2025
19cb49e
Update package.json 4.2
Jithesh0017 Jun 13, 2025
e75fdff
Delete Dockerfile
Jithesh0017 Jun 15, 2025
3f079f7
dra
Jithesh0017 Jun 15, 2025
f8c0126
test pod.yaml
Jithesh0017 Jun 23, 2025
eac1ab9
pods changes
Jithesh0017 Jun 23, 2025
f5f0b10
final changes
Jithesh0017 Jun 23, 2025
e402777
changes
Jithesh0017 Jun 23, 2025
27ab1d8
react-app deploy
Jithesh0017 Jun 24, 2025
08e83bd
react-app service
Jithesh0017 Jun 24, 2025
2488ab0
react k8s
Jithesh0017 Jun 24, 2025
26e24a3
changes
Jithesh0017 Jun 24, 2025
df36ad6
done
Jithesh0017 Jun 24, 2025
314b0ff
deploy
Jithesh0017 Jun 24, 2025
a7337bf
final deploy
Jithesh0017 Jun 24, 2025
7bcba50
k
Jithesh0017 Jun 24, 2025
90a7c14
Delete react-app deployment.yaml
Jithesh0017 Jun 24, 2025
4dad6bf
done
Jithesh0017 Jun 24, 2025
e9baf8b
yu
Jithesh0017 Jun 24, 2025
1e10366
Merge branch 'k8s' of https://github.com/Jithesh0017/react-app into k8s
Jithesh0017 Jun 24, 2025
3be03fc
pod
Jithesh0017 Jun 24, 2025
4233c56
q
Jithesh0017 Jun 24, 2025
fb489d9
ng
Jithesh0017 Jun 24, 2025
1f3732d
okayy
Jithesh0017 Jun 24, 2025
d25fc46
oo
Jithesh0017 Jun 24, 2025
77627fb
app
Jithesh0017 Jun 24, 2025
a17e8b1
pp
Jithesh0017 Jun 24, 2025
13f254b
jj
Jithesh0017 Jun 24, 2025
2a06de5
kk
Jithesh0017 Jun 24, 2025
fde9d15
nm
Jithesh0017 Jun 24, 2025
1edcc95
rr
Jithesh0017 Jun 24, 2025
348461a
oo
Jithesh0017 Jun 24, 2025
d207541
podd
Jithesh0017 Jun 24, 2025
f45f48c
ppp
Jithesh0017 Jun 24, 2025
8b1e432
10
Jithesh0017 Jun 24, 2025
55a9d4f
kk
Jithesh0017 Jun 24, 2025
70224de
kkl
Jithesh0017 Jun 24, 2025
201f8ac
kkll
Jithesh0017 Jun 24, 2025
f48b6b6
ok
Jithesh0017 Jun 24, 2025
5a63786
oooo
Jithesh0017 Jun 24, 2025
4a2f058
ppppw
Jithesh0017 Jun 24, 2025
2290786
LordBalancer
Jithesh0017 Jun 26, 2025
61555ef
LB
Jithesh0017 Jun 26, 2025
bb6fd18
changes lb
Jithesh0017 Jun 26, 2025
3ee866b
done
Jithesh0017 Jun 26, 2025
ab5fdfc
ok
Jithesh0017 Jun 26, 2025
0f43abc
final load
Jithesh0017 Jun 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
# Step 1: Build the React app
FROM node:20 AS build
# - Comment, ignored by docker
# - Docker Directives/intsructions will be in UPPER CASE
# FROM -> used for specifying base image
FROM nginx

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the app for production
RUN npm run build

# Step 2: Set up the production server with Nginx
FROM nginx:alpine

# Copy the build output to Nginx's public directory
COPY --from=build /app/build /usr/share/nginx/html

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
#COPY -> USED FOR COPYING FILES FROM HOST to YOUR CUSTOM IMAGE
COPY . /usr/share/nginx/html
10 changes: 10 additions & 0 deletions k8s/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Pod
metadata:
name: pod-nginx
spec:
containers:
- name: c1
image: nginx
ports:
- containerPort: 80
33 changes: 33 additions & 0 deletions k8s/react-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: react-deployment
labels:
app: react
spec:
replicas: 2
selector:
matchLabels:
app: react
template:
metadata:
labels:
app: react
spec:
containers:
- name: c2
image: jithesh0017/react-app
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: react-service
spec:
type: LoadBalancer
selector:
app: react
ports:
- protocol: TCP
port: 80
12 changes: 12 additions & 0 deletions k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: react-service
spec:
type: NodePort
selector:
app: react
ports:
- protocol: TCP
port: 80
nodePort: 30015
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lms-react",
"version": "1.1",
"version": "4.2",
"private": true,
"dependencies": {
"@testing-library/dom": "^10.4.0",
Expand Down
12 changes: 12 additions & 0 deletions react-app service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: React-app-Service
spec:
type: Nodeport
selector:
app: React-app
ports:
- protocol: TCP
port: 80
nodeport: 30008
2 changes: 1 addition & 1 deletion src/components/FrontPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const FrontPage = () => {
return (
<div className="login-page">
<div className="login-left">
<h1 className="brand-name">Edu Learn</h1>
<h1 className="brand-name">mafia</h1>
<div className="login-card">
<form className="login-form" onSubmit={handleLogin}>
<label>Username</label>
Expand Down