Add 'podman_service.service'
This commit is contained in:
parent
24dfa0c15e
commit
f8c1149e02
25
podman_service.service
Normal file
25
podman_service.service
Normal 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
|
Loading…
Reference in a new issue