From 07a8dec9e67e88f0f253ddef3e1d60bf254b2e54 Mon Sep 17 00:00:00 2001 From: Sunny Date: Sun, 11 Aug 2024 19:43:14 +0530 Subject: [PATCH 1/2] DOCKER: Docker compose added --- Dockerfile | 13 +++++++++++++ README.md | 2 +- docker-compose.yml | 23 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6695c79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:20-alpine + +WORKDIR /app +COPY package.json package-lock.json + +COPY . . + +RUN npm install +RUN npm run build + +EXPOSE 3000 + +CMD ["npm", "run" ,"start"] \ No newline at end of file diff --git a/README.md b/README.md index 88a253d..0dd32c0 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME CLOUDINARY_API_KEY CLOUDINARY_API_SECRET ``` -Then go to setting/upload and eneble unsignedurl then create app and then give a folder name. then go to ad ons and turn on google auto tagging. +Then go to setting/upload and enable unsigned URL then create app and then give a folder name. then go to adOns and turn on google auto tagging. ## Db_URL diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1456d0e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.8' +services: + mongodb: + image: mongo + container_name: mongodb + ports: + - "27017:27017" + volumes: + - mongodb_data:/data/db + + imagemagic-1: + image: swarnendug07/imagemagic + container_name: imagemagic_app + restart: always # Fixed typo: 'alwas' to 'always' + depends_on: + - mongodb + ports: + - "3000:3000" + environment: + MONGO_URL: "mongodb://mongodb:27017" # Added a space after the colon + +volumes: + mongodb_data: From 8228bc97e9b6a67bd033f32bd02471f3c97aa445 Mon Sep 17 00:00:00 2001 From: Sunny Date: Sun, 18 Aug 2024 01:48:36 +0530 Subject: [PATCH 2/2] workflow folder stucture added --- .github/workflows/deploy.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..c2cbd96 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: Build and Deploy to Docker Hub + +on: + push: + branches: + - main +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: check Out Repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Docker image + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile.user + push: true + tags: swarnendug07/fluxcraft:v1 + + - name: Verify Pushed Image + run: docker pull swarnendug07/fluxcraft:v1 \ No newline at end of file