[Unit] Description=Stock Data Collection Service After=network.target postgresql.service [Service] Type=simple User=root WorkingDirectory=/opt/stock-app Environment="DB_HOST=localhost" Environment="DB_PORT=5432" Environment="DB_NAME=stock_app" Environment="DB_USER=postgres" Environment="DB_PASSWORD=stock_password_2025" ExecStart=/opt/stock-app/venv/bin/python stock_data_service.py daemon Restart=always RestartSec=30 [Install] WantedBy=multi-user.target