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 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: