Skip to content

How to restart Docker container? #1360

Discussion options

You must be logged in to vote

I may have answer. You can create a service and have that service launch RA on startup. Here is my service file:

`[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service
StartLimitIntervalSec=60

[Service]
WorkingDirectory=/home/lorenzot/room-assistant
ExecStart=/home/lorenzot/room-assistant/start_docker.sh
ExecStop=/home/lorenzot/room-assistant/stop_docker.sh
TimeoutStartSec=0
Restart=always
StartLimitBurst=1
User=lorenzot

[Install]
WantedBy=multi-user.target`

At the top level of the directory where my config directory resides, I created the two scripts referenced for start/stop of the service.
These contents of these is:
start_docker.sh:

`#!/bin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lorenzothurman
Comment options

Answer selected by lorenzothurman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant