captjack on Nostr: how2tip - auto start any docker container app from hosts systemd service ...
how2tip - auto start any docker container app from hosts systemd service debian/ubuntu #linuxstr
docker.service MUST be ENABLED for auto.start itself
sudo docker update --restart unless-stopped 3c82b4-contID
add new service as below exampe redisdb- "systemctl daemon-reload" + "enable" it also after testing
ExecStart=/home/dir/anyapp.sh
nano /etc/systemd/system/mydocappautostart.service
++++++++++++++++
[Unit]
Description=Redis Container
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStart=/usr/bin/docker run --rm --name %n redis
[Install]
WantedBy=multi-user.target
++++++++++
Published at
2024-11-04 20:00:05Event JSON
{
"id": "0000253cbd1ae57520efade69ade238706295c873d4397b36ba46063912dbc72",
"pubkey": "5e5fc1434c928bcdcba6f801859d5238341093291980fd36e33b7416393d5a2c",
"created_at": 1730750405,
"kind": 1,
"tags": [
[
"t",
"linuxstr"
],
[
"nonce",
"289877",
"18"
]
],
"content": "how2tip - auto start any docker container app from hosts systemd service debian/ubuntu #linuxstr\ndocker.service MUST be ENABLED for auto.start itself\nsudo docker update --restart unless-stopped 3c82b4-contID\nadd new service as below exampe redisdb- \"systemctl daemon-reload\" + \"enable\" it also after testing\nExecStart=/home/dir/anyapp.sh \nnano /etc/systemd/system/mydocappautostart.service\n++++++++++++++++\n[Unit]\nDescription=Redis Container\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nTimeoutStartSec=0\nRestart=always\nExecStart=/usr/bin/docker run --rm --name %n redis\n\n[Install]\nWantedBy=multi-user.target\n++++++++++",
"sig": "afe082861f14bdad4c0bdafb6ee5e57c9df715ae5447aaa6131ca3160965902d8b8f9eab8be1edfe1d52f8459c37db692d1fc5ea2eb0cd0a059080d2d8978429"
}