[Unit]
Description=Windmill Ephemeral Backend Manager
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=sandbox
Group=sandbox
WorkingDirectory=/home/sandbox/ephemeral-backend/windmill
EnvironmentFile=/etc/windmill-ephemeral-manager/.env

# Start the manager
ExecStart=bun run ephemeral-backends/manager

# Restart policy
Restart=on-failure
RestartSec=10s

# Resource limits
LimitNOFILE=65536
LimitNPROC=4096

# Security settings
NoNewPrivileges=true
PrivateTmp=true

# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=windmill-ephemeral-manager

[Install]
WantedBy=multi-user.target
