restart: no
- default mode. Your docker-compose file has a line with restart: no
or restart: unless-stopped
. It also means that when you boot your system, it (and) starts the container again as long as the docker daemon is running. the details
You need to change restart
to no
or on-failure
, for example:
version: '2.1' services: backend: restart: on-failure build: args: USER_ID: ${USER_ID} context: codebase/namp-backend dockerfile: Dockerfile.dev ports: - "5001:5001" - "5851:5851" volumes: - ./codebase/namp-backend:/codebase environment:
In addition, docker-compose down
in most cases gives the same result - do not start containers when you start (docker) the system, except that the containers will be deleted after that, and not stopped.
source share