[Unit] Description=ComposeSync - Docker Compose File Updater After=docker.service Requires=docker.service [Service] Type=simple # User to run the service as. Must be in the 'docker' group. User=YOUR_USERNAME Group=docker WorkingDirectory=/opt/composesync EnvironmentFile=/opt/composesync/.env # Allow the service to access Docker socket Environment=DOCKER_HOST=unix:///var/run/docker.sock # Set the base directory for stacks Environment=COMPOSESYNC_BASE_DIR=/opt/composesync/stacks # Set the number of versions to keep (default: 10) Environment=KEEP_VERSIONS=10 # Set update interval in seconds (default: 3600) Environment=UPDATE_INTERVAL_SECONDS=3600 # Set update mode (notify_only or notify_and_apply) Environment=UPDATE_MODE=notify_and_apply # Optional: Set webhook URL for notifications # Environment=NOTIFICATION_WEBHOOK_URL= # The script will be installed in the installation directory ExecStart=/opt/composesync/update-agent.sh Restart=always RestartSec=5s # Optional: Adjust CPU priority # Nice=10 # Ensure clean shutdown TimeoutStopSec=30 KillMode=mixed KillSignal=SIGTERM [Install] WantedBy=multi-user.target