[Unit]
Description=Orcheo API Server
After=network.target redis.service
Wants=redis.service

[Service]
Type=simple
User=orcheo
Group=orcheo
WorkingDirectory=/opt/orcheo
Environment=PATH=/opt/orcheo/.venv/bin:/usr/bin:/bin
Environment=REDIS_URL=redis://localhost:6379/0
EnvironmentFile=-/etc/orcheo/orcheo.env

ExecStart=/opt/orcheo/.venv/bin/uvicorn \
    --app-dir apps/backend/src \
    orcheo_backend.app:app \
    --host 0.0.0.0 \
    --port 8000

Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
