-
-
Notifications
You must be signed in to change notification settings - Fork 0
Tips and Tricks
Kim Oliver Drechsel edited this page Aug 11, 2024
·
7 revisions
Some Tips and Tricks for using application.
You can add the scale: 0
option in the docker-compose.yml
file to remove a service (container).
The scale
option sets the number of containers to run for the service. Setting it to 0
will scale the service down to zero containers.
Tip
If you set the scale: 0
option to all services in the docker compose file, the entire project will be stopped
and removed, excluding any volumes, networks, and images
(See Known Limitations).
In this example, we add the scale: 0
option to the webserver
service and push the change to the repository.
The webhook will then trigger the deployment, which will stop and remove the container for the webserver
service.
services:
webserver:
scale: 0 # Add this line to remove the service remotely
image: nginx