docker-compose force rebuild
# Build images before starting containers.
docker-compose up --build
# Recreate containers even if configuration/image hasn't changed.
docker-compose up --force-recreate
docker-compose force rebuild
# Build images before starting containers.
docker-compose up --build
# Recreate containers even if configuration/image hasn't changed.
docker-compose up --force-recreate
docker compose restart
restart: "no"
restart: always
restart: on-failure
restart: unless-stopped
docker-compose restart one container
It is very simple: Use the command:
docker-compose restart worker
You can set the time to wait for stop before killing the container (in seconds)
docker-compose restart -t 30 worker
Note that this will restart the container but without rebuilding it. If you want to apply your changes and then restart, take a look at the other answers.
docker --restart example
# To limit retart attempt, add [:int]
docker run -d --restart=on-failure:3
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us