We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 279116f commit 7b31efdCopy full SHA for 7b31efd
.github/workflows/build-and-run.yml
@@ -14,5 +14,11 @@ jobs:
14
- uses: actions/checkout@v4
15
- name: Build the Docker image
16
run: sudo docker build -t backend .
17
+ - name: Stop and remove existing container if it exists
18
+ run: |
19
+ if [ "$(sudo docker ps -aq -f name=backend)" ]; then
20
+ sudo docker stop backend
21
+ sudo docker rm backend
22
+ fi
23
- name: Run the Docker container on port 8000
- run: sudo docker stop backend && sudo docker run -d -p 8000:8000 backend
24
+ run: sudo docker run -d -p 8000:8000 backend
0 commit comments