Published Apr 24, 2024
[
 
]
If you want to remove the container after running while overriding the container’s restart policy, use the --rm
flag:
docker compose run --rm web python manage.py db upgrade
This runs a database upgrade script, and removes the container when finished running, even if a restart policy is specified in the service configuration.