I tried restart: always
, it works at some containers(like php-fpm), but i faced the problem that some containers(like nginx) is still not restarting after reboot.
Solved the problem.
crontab -e
@reboot (sleep 30s ; cd directory_has_dockercomposeyml ; /usr/local/bin/docker-compose up -d )&