[Unit]
Description=RSS2 Backend API (Go)
After=network.target postgresql.service redis.service
Requires=postgresql.service redis.service

[Service]
Type=simple
User=rss2
Group=rss2
WorkingDirectory=/opt/rss2
EnvironmentFile=/opt/rss2/.env
# Sobreescribir hostnames Docker por localhost (los workers Python van directo a DB)
Environment=TRANSLATION_URL=http://127.0.0.1:7790
Environment=OLLAMA_URL=http://127.0.0.1:11434
Environment=SPACY_URL=http://127.0.0.1:8000
ExecStart=/opt/rss2/bin/server
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=rss2-backend

# Limites de recursos
LimitNOFILE=65536
MemoryMax=1G

[Install]
WantedBy=multi-user.target
