Skip to content

Commit 906eb0c

Browse files
committed
Improve podman config of vps
1 parent 520d83c commit 906eb0c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

vps-config-ubuntu.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ I prefer using Podman as it doesn’t require a daemon with root permissions.
9393

9494
```sh
9595
apt install podman
96+
9697
# start app1 at port 8000 as config in nginx, and with inner port 8888
97-
podman run --rm -p 8000:8888 ghcr.io/app1container:latest
98+
# the container automatically restarts if it crashes somehow
99+
podman run --name app1 --restart always -p 8000:8888 ghcr.io/app1container:latest
100+
101+
# create a systemd service to be able to restart also on machine reboot
102+
podman generate systemd -name app1 --restart-policy=always > ~/.config/systemd/user/app1
103+
systemctl --user enable app1
104+
105+
# Ensure lingering is enabled for user services so it starts on boot,
106+
# otherwise it will wait for the user ssh connection
107+
loginctl enable-linger $(whoami)
98108
```

0 commit comments

Comments
 (0)