From a7ad5d46cdfb4a8c25b3dc3263a29c3c582d37eb Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:46:24 +0300 Subject: [PATCH 01/14] Create omar.yml --- .github/workflows/omar.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/omar.yml diff --git a/.github/workflows/omar.yml b/.github/workflows/omar.yml new file mode 100644 index 00000000..864b28ba --- /dev/null +++ b/.github/workflows/omar.yml @@ -0,0 +1,24 @@ +name: build and push to docker-hub +on: + push: + branches: + - omar +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: omar8magdy + password: "${{ secrets.DOCKERHUB_TOKEN }}" + + - name: Build Docker image + run: | + docker build -t omar . + docker tag omar omar8magdy/nodejs-test:omar + docker push omar8magdy/nodejs-test:omar + From 5288b1a14dbceb023ba151c67494b049bddf58a8 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:04:35 +0300 Subject: [PATCH 02/14] Delete .github/workflows/omar.yml --- .github/workflows/omar.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/omar.yml diff --git a/.github/workflows/omar.yml b/.github/workflows/omar.yml deleted file mode 100644 index 864b28ba..00000000 --- a/.github/workflows/omar.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: build and push to docker-hub -on: - push: - branches: - - omar -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: omar8magdy - password: "${{ secrets.DOCKERHUB_TOKEN }}" - - - name: Build Docker image - run: | - docker build -t omar . - docker tag omar omar8magdy/nodejs-test:omar - docker push omar8magdy/nodejs-test:omar - From 702bb1797606df411b2e5c969984eecd0e210d64 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:11:37 +0300 Subject: [PATCH 03/14] Create Dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7eab78e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Use the official Node.js image as the base image +FROM node:5.0.0 + +# Set the working directory inside the container +WORKDIR /app + +# Copy the package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install the dependencies +RUN npm install + +# Copy the rest of the application files to the working directory +COPY . . + +# Build the Vue.js application for production +RUN npm run build + +# Use the official Nginx image to serve the Vue.js application +FROM nginx:alpine + +# Copy the built files from the previous stage to the Nginx web directory +COPY --from=0 /app/dist /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] From 5f2cc70e62d86e40204a1bd8f92b5686cabfe6b7 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:18:44 +0300 Subject: [PATCH 04/14] Update Dockerfile From 258a164fdc71b01b7d541930757ee148d90d3c59 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:38:35 +0300 Subject: [PATCH 05/14] Create vue.yml --- .github/workflows/vue.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/vue.yml diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml new file mode 100644 index 00000000..d7a8ab3c --- /dev/null +++ b/.github/workflows/vue.yml @@ -0,0 +1,24 @@ +name: build and push to docker hub +on: + push: + branches: + - omar +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: omar8magdy + password: "${{ secrets.DOCKERHUB_TOKEN }}" + + - name: Build Docker image + run: | + docker build -t Omar . + docker tag Omar omar8magdy/vue-test:Omar + docker push omar8magdy/vue-test:Omar + From 6579058c567e3709b6ea1de9c80d5e64a9105ad6 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:41:38 +0300 Subject: [PATCH 06/14] Update vue.yml --- .github/workflows/vue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml index d7a8ab3c..1ef8196c 100644 --- a/.github/workflows/vue.yml +++ b/.github/workflows/vue.yml @@ -18,7 +18,7 @@ jobs: - name: Build Docker image run: | - docker build -t Omar . + docker build -t omar . docker tag Omar omar8magdy/vue-test:Omar docker push omar8magdy/vue-test:Omar From 4b9e0d2c7cdf249817fab9c4f4fa9db8dde92700 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:49:55 +0300 Subject: [PATCH 07/14] Update Dockerfile2 --- Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7eab78e6..b264f5c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,6 @@ COPY . . # Build the Vue.js application for production RUN npm run build -# Use the official Nginx image to serve the Vue.js application -FROM nginx:alpine - -# Copy the built files from the previous stage to the Nginx web directory -COPY --from=0 /app/dist /usr/share/nginx/html - # Expose port 80 EXPOSE 80 From 6ad70560e90fde4016f8718b0e77614b97a3a326 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:54:34 +0300 Subject: [PATCH 08/14] Update Dockerfile 3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b264f5c5..f36c8634 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official Node.js image as the base image -FROM node:5.0.0 +FROM node:latest # Set the working directory inside the container WORKDIR /app From fd689caf0d6bea258e2130001e3c31130e0ada10 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:57:27 +0300 Subject: [PATCH 09/14] Update vue.yml 1 --- .github/workflows/vue.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml index 1ef8196c..df1aa7e5 100644 --- a/.github/workflows/vue.yml +++ b/.github/workflows/vue.yml @@ -19,6 +19,6 @@ jobs: - name: Build Docker image run: | docker build -t omar . - docker tag Omar omar8magdy/vue-test:Omar - docker push omar8magdy/vue-test:Omar + docker tag omar omar8magdy/vue-test:omar + docker push omar8magdy/vue-test:omar From fc7093e6cee608aecc28989536c6a3c4dba7f2f9 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:41:02 +0300 Subject: [PATCH 10/14] edit alpine:3.19 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f36c8634..e00425c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official Node.js image as the base image -FROM node:latest +FROM alpine:3.19 # Set the working directory inside the container WORKDIR /app From b410dd02eb2505318f0d222a104650a3f6846268 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:41:59 +0300 Subject: [PATCH 11/14] Update Dockerfile 4 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e00425c7..8f8d86ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official Node.js image as the base image -FROM alpine:3.19 +FROM node:alpine:3.19 # Set the working directory inside the container WORKDIR /app From a5d0385221728549594fd11522928ca5a94cb6a3 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:43:01 +0300 Subject: [PATCH 12/14] Update Dockerfile 5 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8f8d86ea..b4eec9b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official Node.js image as the base image -FROM node:alpine:3.19 +FROM node:3.19 # Set the working directory inside the container WORKDIR /app From 4d75263df0116bae8b361ecb063d0e8900cead6b Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:45:15 +0300 Subject: [PATCH 13/14] Update Dockerfile 22.2.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b4eec9b3..61205733 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official Node.js image as the base image -FROM node:3.19 +FROM node:22.2.0 # Set the working directory inside the container WORKDIR /app From 8b874dea7ecb54d614c13df0e87c3a3dc10caf81 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:16:59 +0300 Subject: [PATCH 14/14] Edit CMD --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 61205733..21f3210a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,5 +19,5 @@ RUN npm run build # Expose port 80 EXPOSE 80 -# Start Nginx -CMD ["nginx", "-g", "daemon off;"] +# Define the command to run your application +CMD ["node", "start"]