[Unit]
Description=CM4 eMMC Provisioning Dashboard
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/cm4-provisioning/dashboard
ExecStart=/usr/bin/python3 -m flask --app app run --host=0.0.0.0 --port=5000
Restart=on-failure
RestartSec=5
Environment=FLASK_ENV=production
# Data dir (portal-files, backups, etc.); override in dashboard.env if needed
Environment=CM4_PROVISIONING_DIR=/var/lib/cm4-provisioning
EnvironmentFile=-/opt/cm4-provisioning/dashboard.env

[Install]
WantedBy=multi-user.target
