Quinn Wynn
Quinn Wynn

Reputation: 1396

Is it possible to config docker-compose to ignore error of one their services and continue others?

I wonder if we have an option to configure docker-compose to ignore errors of one of the containers and continue to start others.

For example, here is my docker-compose.yml

version: '3'
services:
  web:
    build: .
  redis:
    image: redis

If redis container fails to start, the web container still start.

Upvotes: 10

Views: 5502

Answers (1)

Jesse Chisholm
Jesse Chisholm

Reputation: 4026

The only way I know of to do what you are asking is a bit ugly:

Bring your services up one at a time, ignoring any errors:

docker-compose up -d web || true
docker-compose up -d redis || true

Upvotes: 11

Related Questions