Skip to content

Commit

Permalink
stop and remove contaniner to a docker component
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoavellanedat17 committed Jul 9, 2024
1 parent a7199ef commit 83393b2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ jobs:
# Build Docker image
sudo docker build -t fastapi-to-dos .
# Stop previous Docker container (if running)
sudo docker stop fastapi-to-dos || true
# Remove previous Docker container (if exists)
sudo docker rm fastapi-to-dos || true
# Stop and remove all Docker containers
sudo docker stop $(sudo docker ps -aq) || true
sudo docker rm $(sudo docker ps -aq) || true
# Run new Docker container
sudo docker run -p 8000:8000 fastapi-to-dos
Expand Down

0 comments on commit 83393b2

Please sign in to comment.