# Systemd service file for Go Payment Service # Place this file in /etc/systemd/system/payment-service.service # Then run: # sudo systemctl daemon-reload # sudo systemctl enable payment-service # sudo systemctl start payment-service [Unit] Description=Payment Service - Go application for payment processing After=network.target postgresql.service redis.service [Service] Type=simple User=www-data Group=www-data WorkingDirectory=/var/www/html/internet/payment EnvironmentFile=/var/www/html/internet/payment/.env ExecStart=/var/www/html/internet/payment/payment-service Restart=always RestartSec=5 StandardOutput=journal StandardError=journal SyslogIdentifier=payment-service # Security settings NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ProtectHome=true ReadWritePaths=/var/www/html/internet/payment # Resource limits LimitNOFILE=65536 LimitNPROC=4096 [Install] WantedBy=multi-user.target