- config.py: add NEXUS_SERVER_HOST env var for cross-VM deployment - health_service.py: graceful Redis failure when only localhost-bound - systemd service: document remote VM configuration - README: add dedicated 'VM separada' installation section - .env.example: new file with remote connection examples
37 lines
1.8 KiB
Desktop File
37 lines
1.8 KiB
Desktop File
[Unit]
|
|
Description=Nexus Instance Manager (Control Central)
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=root
|
|
WorkingDirectory=/home/Autopartes/manager
|
|
ExecStart=/usr/local/bin/gunicorn -w 2 --threads 4 -b 0.0.0.0:5003 "app:create_app()"
|
|
Restart=always
|
|
RestartSec=5
|
|
|
|
# ─── Local Paths ───────────────────────────────────────────────────────────
|
|
Environment=PYTHONUNBUFFERED=1
|
|
Environment=PYTHONPATH=/home/Autopartes/manager:/home/Autopartes/pos
|
|
Environment=POS_DIR=/home/Autopartes/pos
|
|
|
|
# ─── Database (UPDATE FOR REMOTE VM) ───────────────────────────────────────
|
|
# If manager runs on a separate VM, change localhost to the IP of the
|
|
# PostgreSQL server (e.g. 192.168.10.91).
|
|
Environment=MASTER_DB_URL=postgresql://postgres@localhost/nexus_autoparts
|
|
Environment=TENANT_DB_URL_TEMPLATE=postgresql://postgres@localhost/{db_name}
|
|
|
|
# ─── Remote Nexus Server IP ────────────────────────────────────────────────
|
|
# Set to the IP/hostname of the server running POS/Dashboard/Quart/Redis.
|
|
# Leave as 127.0.0.1 if manager runs on the same server.
|
|
Environment=NEXUS_SERVER_HOST=127.0.0.1
|
|
|
|
# ─── Security (CHANGE THIS) ────────────────────────────────────────────────
|
|
Environment=MANAGER_JWT_SECRET=change-me-to-a-random-64-char-hex-string
|
|
|
|
# ─── Redis (optional, health check only) ───────────────────────────────────
|
|
Environment=REDIS_URL=redis://127.0.0.1:6379/0
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|