[Unit] Description=Voice to Text Whisper API Documentation=https://github.com/yourusername/voice2text After=network.target network-online.target Wants=network-online.target [Service] Type=simple User=www-data Group=www-data WorkingDirectory=/opt/voice2text # Use the virtual environment Python ExecStart=/opt/voice2text/venv/bin/python /opt/voice2text/api.py # Restart policy Restart=always RestartSec=10 # Environment Environment="PATH=/opt/voice2text/venv/bin:/usr/local/bin:/usr/bin:/bin" EnvironmentFile=/opt/voice2text/.env # Security settings NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ProtectHome=true ReadWritePaths=/opt/voice2text/outputs # Logging StandardOutput=journal StandardError=journal SyslogIdentifier=voice2text-api # Resource limits LimitNOFILE=65536 [Install] WantedBy=multi-user.target