Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
soham901 committed Oct 2, 2024
1 parent 279116f commit 7b31efd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/build-and-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@ jobs:
- uses: actions/checkout@v4
- name: Build the Docker image
run: sudo docker build -t backend .
- name: Stop and remove existing container if it exists
run: |
if [ "$(sudo docker ps -aq -f name=backend)" ]; then
sudo docker stop backend
sudo docker rm backend
fi
- name: Run the Docker container on port 8000
run: sudo docker stop backend && sudo docker run -d -p 8000:8000 backend
run: sudo docker run -d -p 8000:8000 backend

0 comments on commit 7b31efd

Please sign in to comment.