Add 'podman_service.service'

This commit is contained in:
Fl1tzi 2023-04-12 01:32:53 +00:00
parent 24dfa0c15e
commit f8c1149e02

25
podman_service.service Normal file
View file

@ -0,0 +1,25 @@
# folder: ~/.config/systemd/user/
[Unit]
Description=Example Container
After=network.target
[Service]
# the container folder
Environment="CONTAINER=example_folder"
WorkingDirectory=$HOME/compose/$CONTAINER
RestartSec=10
Restart=on-failure
# Clean-up the containers that may still be alive
ExecStartPre=$HOME/.local/bin/podman-compose down
# Start
ExecStart=$HOME/.local/bin/podman-compose up
# Stop
ExecStop=$HOME/.local/bin/podman-compose down
[Install]
WantedBy=default.target