sajad torkamani

Use the below command to start a Docker Compose service with an interactive bash or sh shell inside a Docker Compose service and then have Docker remove the service as soon as you exit the shell:

docker compose run --rm --entrypoint <bash|sh> <service-name>