From a351fbb56f3e4dd19abb44141dea8ad38ba06878 Mon Sep 17 00:00:00 2001 From: arvind Date: Fri, 24 Jul 2026 19:36:26 +0530 Subject: [PATCH 01/13] Added Dockerfile for containerizing the application --- Dockerfile | 15 +++++++++++++++ package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..67c5e983 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:20 + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + +EXPOSE 1234 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/package.json b/package.json index 6ff84628..a5bee5db 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "JavaScript Snake
By Patrick Gillespie
License: MIT
http://patorjk.com/games/snake", "scripts": { - "start": "parcel src/index.html --open", + "start": "parcel src/index.html", "build": "parcel build src/index.html", "test": "echo \"Error: no test specified\" && exit 1" }, From 6ed807101193e7c6fb66c19d5141c6d0976db5aa Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Mon, 3 Aug 2026 21:57:37 +0530 Subject: [PATCH 02/13] Add deployment configuration for snake-app --- deployment.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 deployment.yaml diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 00000000..ee1a5b53 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: snake-app +spec: + replicas: 2 + selector: + matchLabels: + app: snake + template: + metadata: + labels: + app: snake + spec: + containers: + - name: snake + image: arvindgirish/snake:latest + imagePullPolicy: Always + ports: + - containerPort: 80 From b609fd61d53a857c83d81e301766501530834e35 Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Mon, 3 Aug 2026 21:58:07 +0530 Subject: [PATCH 03/13] Add LoadBalancer service for snake application --- service.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 service.yaml diff --git a/service.yaml b/service.yaml new file mode 100644 index 00000000..b500bef2 --- /dev/null +++ b/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: snake-service +spec: + type: LoadBalancer + selector: + app: snake + ports: + - port: 80 + targetPort: 80 From 091307f5e7aed85e05a8621f58b714b663353bdc Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Mon, 3 Aug 2026 22:38:08 +0530 Subject: [PATCH 04/13] Change targetPort from 80 to 1234 in service.yaml --- service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service.yaml b/service.yaml index b500bef2..34b08826 100644 --- a/service.yaml +++ b/service.yaml @@ -8,4 +8,4 @@ spec: app: snake ports: - port: 80 - targetPort: 80 + targetPort: 1234 From 4358327643a02f2c1234266c2791351198e99869 Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Mon, 3 Aug 2026 22:38:22 +0530 Subject: [PATCH 05/13] Change container port from 80 to 1234 --- deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment.yaml b/deployment.yaml index ee1a5b53..8a59f14d 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -17,4 +17,4 @@ spec: image: arvindgirish/snake:latest imagePullPolicy: Always ports: - - containerPort: 80 + - containerPort: 1234 From 143d13227d8c2c1906eb0b3b87782abf314c0ebf Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Mon, 3 Aug 2026 22:42:19 +0530 Subject: [PATCH 06/13] Update Dockerfile --- Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 67c5e983..a9cbf451 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,19 @@ -FROM node:20 +# Build Stage +FROM node:20 AS builder WORKDIR /app COPY package*.json ./ - RUN npm install COPY . . - RUN npm run build -EXPOSE 1234 +# Production Stage +FROM nginx:alpine + +COPY --from=builder /app/dist /usr/share/nginx/html + +EXPOSE 80 -CMD ["npm", "start"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"] From 786e62c11d97224362f350c57da46e97cce04784 Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Mon, 3 Aug 2026 22:42:34 +0530 Subject: [PATCH 07/13] Update targetPort in service.yaml to 80 --- service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service.yaml b/service.yaml index 34b08826..b500bef2 100644 --- a/service.yaml +++ b/service.yaml @@ -8,4 +8,4 @@ spec: app: snake ports: - port: 80 - targetPort: 1234 + targetPort: 80 From fe6418b998dd5849e2a495f3903184a689d74338 Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Mon, 3 Aug 2026 22:42:49 +0530 Subject: [PATCH 08/13] Update deployment.yaml --- deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment.yaml b/deployment.yaml index 8a59f14d..ee1a5b53 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -17,4 +17,4 @@ spec: image: arvindgirish/snake:latest imagePullPolicy: Always ports: - - containerPort: 1234 + - containerPort: 80 From 4873d3c966aff4b37a4f81df6bf1797dcf2dfe1c Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Fri, 7 Aug 2026 02:00:30 +0530 Subject: [PATCH 09/13] Rename deployment from snake-app to online-app --- deployment.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deployment.yaml b/deployment.yaml index ee1a5b53..5ec94847 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -1,20 +1,20 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: snake-app + name: online-app spec: replicas: 2 selector: matchLabels: - app: snake + app: online template: metadata: labels: - app: snake + app: online spec: containers: - - name: snake - image: arvindgirish/snake:latest + - name: online + image: arvindgirish/online:latest imagePullPolicy: Always ports: - containerPort: 80 From b70bce7f103fc418827649d6db3b9323d13a28cf Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Fri, 7 Aug 2026 02:00:59 +0530 Subject: [PATCH 10/13] Rename service from snake-service to online-service --- service.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service.yaml b/service.yaml index b500bef2..a7de5583 100644 --- a/service.yaml +++ b/service.yaml @@ -1,11 +1,11 @@ apiVersion: v1 kind: Service metadata: - name: snake-service + name: online-service spec: type: LoadBalancer selector: - app: snake + app: online ports: - port: 80 targetPort: 80 From 6a6b7ccd4ce170b53cfbee854fc7e1485a172fa7 Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Fri, 7 Aug 2026 02:04:53 +0530 Subject: [PATCH 11/13] Update service.yaml --- service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service.yaml b/service.yaml index a7de5583..78d154a1 100644 --- a/service.yaml +++ b/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: online-service + name: snake-service spec: type: LoadBalancer selector: From 28fcaa9dabedb1f727884eb461a78fab97171eaa Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Fri, 7 Aug 2026 02:05:32 +0530 Subject: [PATCH 12/13] Rename deployment from online-app to snake-app --- deployment.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deployment.yaml b/deployment.yaml index 5ec94847..ee1a5b53 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -1,20 +1,20 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: online-app + name: snake-app spec: replicas: 2 selector: matchLabels: - app: online + app: snake template: metadata: labels: - app: online + app: snake spec: containers: - - name: online - image: arvindgirish/online:latest + - name: snake + image: arvindgirish/snake:latest imagePullPolicy: Always ports: - containerPort: 80 From 7b332ec8e11edf6dff661a915d8acc12da90f55e Mon Sep 17 00:00:00 2001 From: Arvin910 Date: Fri, 7 Aug 2026 02:24:33 +0530 Subject: [PATCH 13/13] Update deployment.yaml --- deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment.yaml b/deployment.yaml index ee1a5b53..72f9b67f 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -17,4 +17,4 @@ spec: image: arvindgirish/snake:latest imagePullPolicy: Always ports: - - containerPort: 80 + - containerPort: 8080