From 035eeb76b3f9da4e82615c9d2dd8800f59b90aa9 Mon Sep 17 00:00:00 2001 From: CloudYuga Technologies Date: Wed, 15 Feb 2017 15:47:01 +0530 Subject: [PATCH 01/27] Delete csvdata.html --- templates/csvdata.html | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100755 templates/csvdata.html diff --git a/templates/csvdata.html b/templates/csvdata.html deleted file mode 100755 index a7c1144e..00000000 --- a/templates/csvdata.html +++ /dev/null @@ -1,18 +0,0 @@ - - -
- - -CLick - - - - -
- - - - - From 7d10a1716e7997e98fd9dd865de0860a1bcf49cc Mon Sep 17 00:00:00 2001 From: CloudYuga Technologies Date: Sun, 27 Aug 2017 13:14:48 +0530 Subject: [PATCH 02/27] Update profile.html to fix issue 1 --- templates/profile.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/profile.html b/templates/profile.html index b957f9aa..b634c994 100755 --- a/templates/profile.html +++ b/templates/profile.html @@ -34,16 +34,15 @@

RSVP Count : {{counter}}

Email - {% for item in items %} + {% for item in items %} {{ item.name }} {{ item.email }} + {% endfor %} - - + - From 4b2ffd434b398094ccaacc43fa390be655e7644a Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Fri, 14 Sep 2018 16:39:04 +0530 Subject: [PATCH 03/27] Update profile.html --- templates/profile.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/profile.html b/templates/profile.html index b634c994..55ac1719 100755 --- a/templates/profile.html +++ b/templates/profile.html @@ -18,11 +18,11 @@

Serving from Host: {{ hostname }}
- +
- +
From 53369d96c748139278052561d393aac5d434c4cf Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Fri, 14 Sep 2018 16:44:12 +0530 Subject: [PATCH 04/27] Update profile.html --- templates/profile.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/profile.html b/templates/profile.html index 55ac1719..bf7ae769 100755 --- a/templates/profile.html +++ b/templates/profile.html @@ -18,11 +18,11 @@

Serving from Host: {{ hostname }}
- +
- +
From 3fcb5c9fe40e563bcdc839d8f1093e114ec8ee82 Mon Sep 17 00:00:00 2001 From: CloudYuga Technologies Date: Mon, 24 Sep 2018 13:43:09 +0530 Subject: [PATCH 05/27] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index f54decca..5db91473 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: mongodb: image: mongo:3.3 From 0335e0f350bddff80f3f3365275edb3341321a12 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:21:12 -0700 Subject: [PATCH 06/27] Create .circleci --- .circleci | 1 + 1 file changed, 1 insertion(+) create mode 100644 .circleci diff --git a/.circleci b/.circleci new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.circleci @@ -0,0 +1 @@ + From 83cf2fc17ead68a5065c282786eeaf45db05279d Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:21:34 -0700 Subject: [PATCH 07/27] Delete .circleci --- .circleci | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .circleci diff --git a/.circleci b/.circleci deleted file mode 100644 index 8b137891..00000000 --- a/.circleci +++ /dev/null @@ -1 +0,0 @@ - From 61bf44c62184fa99ae68c1b0a0c8e0db3e964ec0 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:25:04 -0700 Subject: [PATCH 08/27] Create config.yml --- .circleci/config.yml | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..a091c365 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,74 @@ +version: 2 +jobs: + test: + machine: + image: circleci/classic:201808-01 + docker_layer_caching: true + working_directory: ~/repo + + steps: + - checkout + - run: + name: install dependencies + command: | + sudo rm /var/lib/dpkg/lock + sudo dpkg --configure -a + sudo apt-get install software-properties-common + sudo add-apt-repository ppa:fkrull/deadsnakes + sudo apt-get update + sleep 5 + sudo rm /var/lib/dpkg/lock + sudo dpkg --configure -a + sudo apt-get install python3.5 + sleep 5 + python -m pip install -r requirements.txt + + # run tests! + # this example uses Django's built-in test-runner + # other common Python testing frameworks include pytest and nose + # https://pytest.org + # https://nose.readthedocs.io + + - run: + name: run tests + command: | + python -m pytest tests/test_rsvpapp.py + + build: + machine: + image: circleci/classic:201808-01 + docker_layer_caching: true + working_directory: ~/repo + + steps: + - checkout + - run: + name: build image + command: | + docker build -t nkhare/rsvpapp:dev . + + push: + machine: + image: circleci/classic:201808-01 + docker_layer_caching: true + working_directory: ~/repo + steps: + - checkout + - run: + name: Push image + command: | + docker build -t nkhare/rsvpapp:dev . + cat my_password.txt | docker login --username nkhare --password-stdin + docker push nkhare/rsvpapp:dev + +workflows: + version: 2 + build-and-deploy: + jobs: + - test + - build: + requires: + - test + - push: + requires: + - build From 93f7d41cad029537e0e04edc9c5a06ad0a316c54 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:35:24 -0700 Subject: [PATCH 09/27] Update config.yml --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a091c365..869af13c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: - run: name: build image command: | - docker build -t nkhare/rsvpapp:dev . + docker build -t $DOCKERHUB_USER/rsvpapp:dev . push: machine: @@ -57,9 +57,9 @@ jobs: - run: name: Push image command: | - docker build -t nkhare/rsvpapp:dev . - cat my_password.txt | docker login --username nkhare --password-stdin - docker push nkhare/rsvpapp:dev + docker build -t $DOCKERHUB_USER/rsvpapp:dev . + echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USER --password-stdin + docker push $DOCKERHUB_USER/rsvpapp:dev workflows: version: 2 From 7b5753031fb882c7ed66d3ee42da1587b980f9ee Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:37:29 -0700 Subject: [PATCH 10/27] Create config.yaml --- .config/config.yaml | 74 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .config/config.yaml diff --git a/.config/config.yaml b/.config/config.yaml new file mode 100644 index 00000000..869af13c --- /dev/null +++ b/.config/config.yaml @@ -0,0 +1,74 @@ +version: 2 +jobs: + test: + machine: + image: circleci/classic:201808-01 + docker_layer_caching: true + working_directory: ~/repo + + steps: + - checkout + - run: + name: install dependencies + command: | + sudo rm /var/lib/dpkg/lock + sudo dpkg --configure -a + sudo apt-get install software-properties-common + sudo add-apt-repository ppa:fkrull/deadsnakes + sudo apt-get update + sleep 5 + sudo rm /var/lib/dpkg/lock + sudo dpkg --configure -a + sudo apt-get install python3.5 + sleep 5 + python -m pip install -r requirements.txt + + # run tests! + # this example uses Django's built-in test-runner + # other common Python testing frameworks include pytest and nose + # https://pytest.org + # https://nose.readthedocs.io + + - run: + name: run tests + command: | + python -m pytest tests/test_rsvpapp.py + + build: + machine: + image: circleci/classic:201808-01 + docker_layer_caching: true + working_directory: ~/repo + + steps: + - checkout + - run: + name: build image + command: | + docker build -t $DOCKERHUB_USER/rsvpapp:dev . + + push: + machine: + image: circleci/classic:201808-01 + docker_layer_caching: true + working_directory: ~/repo + steps: + - checkout + - run: + name: Push image + command: | + docker build -t $DOCKERHUB_USER/rsvpapp:dev . + echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USER --password-stdin + docker push $DOCKERHUB_USER/rsvpapp:dev + +workflows: + version: 2 + build-and-deploy: + jobs: + - test + - build: + requires: + - test + - push: + requires: + - build From 41f206e6d21ac9dedab7ddc461505e9753ce0749 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:39:16 -0700 Subject: [PATCH 11/27] Rename .config/config.yaml to .circleci/config.yaml --- {.config => .circleci}/config.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.config => .circleci}/config.yaml (100%) diff --git a/.config/config.yaml b/.circleci/config.yaml similarity index 100% rename from .config/config.yaml rename to .circleci/config.yaml From 3f5f718adbfe0b505cc558219a606fe7a1162c7e Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:41:23 -0700 Subject: [PATCH 12/27] Rename config.yaml to config.yml --- .circleci/{config.yaml => config.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .circleci/{config.yaml => config.yml} (100%) diff --git a/.circleci/config.yaml b/.circleci/config.yml similarity index 100% rename from .circleci/config.yaml rename to .circleci/config.yml From d70f2eea360e0686fc761d1bbadda1078302d689 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:49:05 -0700 Subject: [PATCH 13/27] Update config.yml --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 869af13c..f781c7ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,8 +67,10 @@ workflows: jobs: - test - build: + context: DOCKERHUB requires: - test - push: + context: DOCKERHUB requires: - build From a62fef38310368735284688b8c86f37aa289a5e0 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 21:52:37 -0700 Subject: [PATCH 14/27] Delete config.yml --- .circleci/config.yml | 74 -------------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 869af13c..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,74 +0,0 @@ -version: 2 -jobs: - test: - machine: - image: circleci/classic:201808-01 - docker_layer_caching: true - working_directory: ~/repo - - steps: - - checkout - - run: - name: install dependencies - command: | - sudo rm /var/lib/dpkg/lock - sudo dpkg --configure -a - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:fkrull/deadsnakes - sudo apt-get update - sleep 5 - sudo rm /var/lib/dpkg/lock - sudo dpkg --configure -a - sudo apt-get install python3.5 - sleep 5 - python -m pip install -r requirements.txt - - # run tests! - # this example uses Django's built-in test-runner - # other common Python testing frameworks include pytest and nose - # https://pytest.org - # https://nose.readthedocs.io - - - run: - name: run tests - command: | - python -m pytest tests/test_rsvpapp.py - - build: - machine: - image: circleci/classic:201808-01 - docker_layer_caching: true - working_directory: ~/repo - - steps: - - checkout - - run: - name: build image - command: | - docker build -t $DOCKERHUB_USER/rsvpapp:dev . - - push: - machine: - image: circleci/classic:201808-01 - docker_layer_caching: true - working_directory: ~/repo - steps: - - checkout - - run: - name: Push image - command: | - docker build -t $DOCKERHUB_USER/rsvpapp:dev . - echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USER --password-stdin - docker push $DOCKERHUB_USER/rsvpapp:dev - -workflows: - version: 2 - build-and-deploy: - jobs: - - test - - build: - requires: - - test - - push: - requires: - - build From e11cec557df442c1d73cd8b0c999d4b16351da6d Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 22:08:41 -0700 Subject: [PATCH 15/27] Create rsvp.yaml --- k8s/rsvp.yaml | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 k8s/rsvp.yaml diff --git a/k8s/rsvp.yaml b/k8s/rsvp.yaml new file mode 100644 index 00000000..55238e33 --- /dev/null +++ b/k8s/rsvp.yaml @@ -0,0 +1,84 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rsvp +spec: + replicas: 4 + selector: + matchLabels: + app: rsvp + template: + metadata: + labels: + app: rsvp + spec: + containers: + - name: rsvp-app + image: nkhare/rsvpapp:dev + imagePullPolicy: Always + livenessProbe: + httpGet: + path: / + port: 5000 + periodSeconds: 30 + timeoutSeconds: 1 + initialDelaySeconds: 50 + env: + - name: MONGODB_HOST + value: mongodb + ports: + - containerPort: 5000 + name: web-port +--- +apiVersion: v1 +kind: Service +metadata: + name: rsvp + labels: + app: rsvp +spec: + type: NodePort + ports: + - port: 80 + targetPort: web-port + protocol: TCP + selector: + app: rsvp + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rsvp-db +spec: + replicas: 1 + selector: + matchLabels: + appdb: rsvpdb + template: + metadata: + labels: + appdb: rsvpdb + spec: + containers: + - name: rsvpd-db + image: mongo:3.3 + env: + - name: MONGODB_DATABASE + value: rsvpdata + ports: + - containerPort: 27017 + +--- +apiVersion: v1 +kind: Service +metadata: + name: mongodb + labels: + app: rsvpdb +spec: + ports: + - port: 27017 + protocol: TCP + selector: + appdb: rsvpdb From 7b084c455996800c30e1f53cb0fa1b638a91415a Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 22:15:25 -0700 Subject: [PATCH 16/27] Update profile.html --- templates/profile.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/profile.html b/templates/profile.html index bf7ae769..fadc0f79 100755 --- a/templates/profile.html +++ b/templates/profile.html @@ -18,11 +18,11 @@

Serving from Host: {{ hostname }}
- +
- +
From 01812b11495dd2a4aff5c545a8816513aa5eef53 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 22:18:10 -0700 Subject: [PATCH 17/27] Update rsvp.yaml --- k8s/rsvp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/rsvp.yaml b/k8s/rsvp.yaml index 55238e33..8e932c89 100644 --- a/k8s/rsvp.yaml +++ b/k8s/rsvp.yaml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: rsvp spec: - replicas: 4 + replicas: 2 selector: matchLabels: app: rsvp From 6ed1b449f83f01203301b07dc824f46d4dd0b328 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 22:24:27 -0700 Subject: [PATCH 18/27] Update config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f781c7ee..65ad6efb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: - run: name: build image command: | - docker build -t $DOCKERHUB_USER/rsvpapp:dev . + docker build -t $DOCKERHUB_USER/rsvpapp:prod . push: machine: @@ -57,9 +57,9 @@ jobs: - run: name: Push image command: | - docker build -t $DOCKERHUB_USER/rsvpapp:dev . + docker build -t $DOCKERHUB_USER/rsvpapp:prod . echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USER --password-stdin - docker push $DOCKERHUB_USER/rsvpapp:dev + docker push $DOCKERHUB_USER/rsvpapp:prod workflows: version: 2 From 68320e8dbf0ea83cd937f78b999193f585b91be4 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Mon, 15 Oct 2018 22:30:14 -0700 Subject: [PATCH 19/27] Update rsvp.yaml --- k8s/rsvp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/rsvp.yaml b/k8s/rsvp.yaml index 8e932c89..41c73b7b 100644 --- a/k8s/rsvp.yaml +++ b/k8s/rsvp.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: rsvp-app - image: nkhare/rsvpapp:dev + image: nkhare/rsvpapp:prod imagePullPolicy: Always livenessProbe: httpGet: From 0ad673a4a9ef9fe2b4164d258f7f92954eab9c5a Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Tue, 16 Oct 2018 21:39:04 -0700 Subject: [PATCH 20/27] Update config.yml --- .circleci/config.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65ad6efb..2e082daf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ jobs: python -m pytest tests/test_rsvpapp.py build: + machine: image: circleci/classic:201808-01 docker_layer_caching: true @@ -45,7 +46,7 @@ jobs: - run: name: build image command: | - docker build -t $DOCKERHUB_USER/rsvpapp:prod . + docker build -t $DOCKERHUB_USERNAME/rsvpapp:$CIRCLE_SHA1 . push: machine: @@ -57,20 +58,30 @@ jobs: - run: name: Push image command: | - docker build -t $DOCKERHUB_USER/rsvpapp:prod . - echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USER --password-stdin - docker push $DOCKERHUB_USER/rsvpapp:prod + docker build -t $DOCKERHUB_USERNAME/rsvpapp:$CIRCLE_SHA1 . + echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin + docker push $DOCKERHUB_USERNAME/rsvpapp:$CIRCLE_SHA1 workflows: version: 2 - build-and-deploy: + build-deploy: jobs: - - test - - build: + - test: context: DOCKERHUB + filters: + branches: + only: dev + - build: + context: DOCKERHUB requires: - - test + - test + filters: + branches: + only: dev - push: context: DOCKERHUB requires: - build + filters: + branches: + only: dev From 0382a70ad2630a72d46b6db867f6f496525dd642 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Tue, 16 Oct 2018 21:44:20 -0700 Subject: [PATCH 21/27] Delete config.yml --- .circleci/config.yml | 87 -------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 2e082daf..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,87 +0,0 @@ -version: 2 -jobs: - test: - machine: - image: circleci/classic:201808-01 - docker_layer_caching: true - working_directory: ~/repo - - steps: - - checkout - - run: - name: install dependencies - command: | - sudo rm /var/lib/dpkg/lock - sudo dpkg --configure -a - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:fkrull/deadsnakes - sudo apt-get update - sleep 5 - sudo rm /var/lib/dpkg/lock - sudo dpkg --configure -a - sudo apt-get install python3.5 - sleep 5 - python -m pip install -r requirements.txt - - # run tests! - # this example uses Django's built-in test-runner - # other common Python testing frameworks include pytest and nose - # https://pytest.org - # https://nose.readthedocs.io - - - run: - name: run tests - command: | - python -m pytest tests/test_rsvpapp.py - - build: - - machine: - image: circleci/classic:201808-01 - docker_layer_caching: true - working_directory: ~/repo - - steps: - - checkout - - run: - name: build image - command: | - docker build -t $DOCKERHUB_USERNAME/rsvpapp:$CIRCLE_SHA1 . - - push: - machine: - image: circleci/classic:201808-01 - docker_layer_caching: true - working_directory: ~/repo - steps: - - checkout - - run: - name: Push image - command: | - docker build -t $DOCKERHUB_USERNAME/rsvpapp:$CIRCLE_SHA1 . - echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin - docker push $DOCKERHUB_USERNAME/rsvpapp:$CIRCLE_SHA1 - -workflows: - version: 2 - build-deploy: - jobs: - - test: - context: DOCKERHUB - filters: - branches: - only: dev - - build: - context: DOCKERHUB - requires: - - test - filters: - branches: - only: dev - - push: - context: DOCKERHUB - requires: - - build - filters: - branches: - only: dev From 7cb4cd323724ad2e1011ce92e66509e074309b09 Mon Sep 17 00:00:00 2001 From: Neependra Khare Date: Tue, 16 Oct 2018 21:44:31 -0700 Subject: [PATCH 22/27] Delete rsvp.yaml --- k8s/rsvp.yaml | 84 --------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 k8s/rsvp.yaml diff --git a/k8s/rsvp.yaml b/k8s/rsvp.yaml deleted file mode 100644 index 41c73b7b..00000000 --- a/k8s/rsvp.yaml +++ /dev/null @@ -1,84 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: rsvp -spec: - replicas: 2 - selector: - matchLabels: - app: rsvp - template: - metadata: - labels: - app: rsvp - spec: - containers: - - name: rsvp-app - image: nkhare/rsvpapp:prod - imagePullPolicy: Always - livenessProbe: - httpGet: - path: / - port: 5000 - periodSeconds: 30 - timeoutSeconds: 1 - initialDelaySeconds: 50 - env: - - name: MONGODB_HOST - value: mongodb - ports: - - containerPort: 5000 - name: web-port ---- -apiVersion: v1 -kind: Service -metadata: - name: rsvp - labels: - app: rsvp -spec: - type: NodePort - ports: - - port: 80 - targetPort: web-port - protocol: TCP - selector: - app: rsvp - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: rsvp-db -spec: - replicas: 1 - selector: - matchLabels: - appdb: rsvpdb - template: - metadata: - labels: - appdb: rsvpdb - spec: - containers: - - name: rsvpd-db - image: mongo:3.3 - env: - - name: MONGODB_DATABASE - value: rsvpdata - ports: - - containerPort: 27017 - ---- -apiVersion: v1 -kind: Service -metadata: - name: mongodb - labels: - app: rsvpdb -spec: - ports: - - port: 27017 - protocol: TCP - selector: - appdb: rsvpdb From aead1a6189de8b9c213eeabd14bab743710f8cad Mon Sep 17 00:00:00 2001 From: CloudYuga Technologies Date: Tue, 22 Jun 2021 17:39:55 +0530 Subject: [PATCH 23/27] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index effe8577..8830e0d5 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM teamcloudyuga/python:alpine +FROM python:3 COPY . /usr/src/app WORKDIR /usr/src/app ENV LINK http://www.meetup.com/cloudyuga/ From 5638c9c1b057e8d847e70fb0f6e20ddaa60a5a2f Mon Sep 17 00:00:00 2001 From: Oshi Gupta Date: Thu, 7 Sep 2023 10:35:30 +0000 Subject: [PATCH 24/27] optimized Dockerfile related to image size and for security --- .dockerignore | 17 +++++++++++++++++ Dockerfile | 30 ++++++++++++++++++++++++++---- __init__.py | 0 docker-compose.yml | 4 ++-- 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 .dockerignore delete mode 100755 __init__.py diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..db81c3ad --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +LICENSE +README.md +Dockerfile +.git +__pycache__ +.tox +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.log +.Python +env + + diff --git a/Dockerfile b/Dockerfile index 8830e0d5..632f5808 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,32 @@ -FROM python:3 -COPY . /usr/src/app +FROM python:3.9.18-slim as build +RUN apt-get update +RUN apt-get install -y --no-install-recommends \ + build-essential gcc + WORKDIR /usr/src/app +RUN python -m venv /usr/src/app/venv +ENV PATH="/usr/src/app/venv/bin:$PATH" + +COPY requirements.txt . +RUN pip3 install --upgrade pip +RUN pip3 install --no-cache-dir -r requirements.txt + +FROM python:3.9.18-slim +RUN groupadd -g 999 python && \ + useradd -r -u 999 -g python python +RUN mkdir /usr/src/app && chown python:python /usr/src/app +WORKDIR /usr/src/app/venv +COPY --chown=python:python --from=build /usr/src/app/venv /usr/src/app/venv +COPY --chown=python:python . . +USER 999 + ENV LINK http://www.meetup.com/cloudyuga/ ENV TEXT1 CloudYuga ENV TEXT2 Garage RSVP! ENV LOGO https://raw.githubusercontent.com/cloudyuga/rsvpapp/master/static/cloudyuga.png ENV COMPANY CloudYuga Technology Pvt. Ltd. -RUN pip3 install -r requirements.txt -CMD python rsvp.py + +ENV PATH="/usr/src/app/venv/bin:$PATH" +EXPOSE 5000 +CMD ["python", "rsvp.py"] + diff --git a/__init__.py b/__init__.py deleted file mode 100755 index e69de29b..00000000 diff --git a/docker-compose.yml b/docker-compose.yml index 5db91473..efc644f0 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: mongodb: - image: mongo:3.3 + image: mongo:3.6 expose: - "27017" volumes: @@ -12,7 +12,7 @@ services: - rsvpnet web: - image: teamcloudyuga/rsvpapp:mooc + image: registry.cloudyuga.guru/library/rsvpapp:latest ports: - "5000:5000" environment: From 9fd0f8090672a6fcd8a5c433f571488029b23076 Mon Sep 17 00:00:00 2001 From: Oshi Gupta Date: Fri, 22 Sep 2023 16:33:12 +0000 Subject: [PATCH 25/27] changed image version from latest to v1 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index efc644f0..d0fc2edd 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: - rsvpnet web: - image: registry.cloudyuga.guru/library/rsvpapp:latest + image: registry.cloudyuga.guru/library/rsvpapp:v1 ports: - "5000:5000" environment: From 7c0c53238b58a76b0d1b085cf53693a3656d4d8c Mon Sep 17 00:00:00 2001 From: Oshi Gupta <47573417+oshi36@users.noreply.github.com> Date: Fri, 22 Sep 2023 22:13:28 +0530 Subject: [PATCH 26/27] Update README.md --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d09f920..74501c19 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,35 @@ -# rsvpapp +# RSVP App in Python RSVP app by CloudYuga +## Steps to run the application locally +- Clone this repository +``` +git clone https://github.com/cloudyuga/rsvpapp.git +``` +- Install python and pip package manager +- Install python packages mentioned in `requirements.txt` file +``` +pip install -r requirements.txt +``` +- Install mongodb for the database.One can use mongodb as a docker container also. +``` +docker container run -d -p 27017:27017 –name=mongodb mongo:3.6 +``` +- Run the python app locally +``` +python3 rsvp.py +``` +Access the application locally on port number 5000. + +## Build the Docker image of the application +- Build the Docker image from the `Dockerfile` +``` +docker build -t /rsvpapp-python:v1 . +``` +- Start the frontend and backend of the application with the help of docker compose. +``` +docker compose up -d +``` + ## Credits Thanks to [Anand Chitipothu](https://twitter.com/anandology) for helping us with the application development. From a2016a016a60f5b9bb75192eac664bb20a59ef8e Mon Sep 17 00:00:00 2001 From: Oshi Gupta <47573417+oshi36@users.noreply.github.com> Date: Fri, 22 Sep 2023 22:14:09 +0530 Subject: [PATCH 27/27] fixed typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74501c19..109d7b97 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ pip install -r requirements.txt ``` - Install mongodb for the database.One can use mongodb as a docker container also. ``` -docker container run -d -p 27017:27017 –name=mongodb mongo:3.6 +docker container run -d -p 27017:27017 --name=mongodb mongo:3.6 ``` - Run the python app locally ```