I have a docker-compose project using Docker for Mac that autostarts when I boot the computer.
I usually start the project with docker-compose up -d
, but ev
restart: no is default mode. There is line inside your docker-compose file with restart: no
or restart: unless-stopped
. It also means that when you boot your system, it (re)starts container(s) again as long as docker daemon. Details
You need to change restart
to no
or on-failure
, 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:
Also docker-compose down
for most cases, gives you the same result - do not start containers while (docker) system startup, except: containers will be deleted after this, not stopped.