[Unit] Description=Database container Requires=docker.service After=docker.service After=rc-local.service StartLimitIntervalSec=1200 StartLimitBurst=3 [Service] User=root ExecStartPre=/usr/bin/{{docker_container_name}}.sh start ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop Restart=always RestartSec=30 [Install] WantedBy=multi-user.target