diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 330692e..8bf2fb8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,12 +25,12 @@ jobs: # Step 3: Build the Docker image - name: Build Docker image run: | - docker build -t ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:5.0 . + docker build -t ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:7.0 . # Step 4: Push Docker image to DockerHub - name: Push Docker image run: | - docker push ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:5.0 + docker push ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:7.0 # Step 5: SSH to EC2 and deploy the Docker container - name: Deploy to EC2 @@ -42,7 +42,7 @@ jobs: port: 22 script: | # Pull the latest image - sudo docker pull ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:5.0 + sudo docker pull ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:7.0 # Check if the container is running and stop/remove it if it exists if [ "$(sudo docker ps -a -q -f name=nextblog)" ]; then @@ -58,4 +58,4 @@ jobs: # Run the container echo "Starting a new container..." - sudo docker run -d --name nextblog --env-file .env -p 9000:5000 ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:5.0 + sudo docker run -d --name nextblog --env-file .env -p 9000:5000 ${{ secrets.DOCKERHUB_USER_NAME }}/nextblog:7.0 diff --git a/Dockerfile b/Dockerfile index 5eac88a..d25b658 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,4 @@ COPY . . EXPOSE 5000 # Define the command to run your application. -CMD ["sh", "-c", "npx prisma generate && npx prisma migrate deploy && yarn build && yarn start"] +CMD ["sh", "-c", "yarn migrate && yarn build && yarn start"]