useful_web_tools/cert_decoder/cert-decoder.service

23 lines
618 B
SYSTEMD

[Unit]
Description=TLS cert decoder application
After=network.target
[Service]
WorkingDirectory=/srv/useful_web_tools/cert_decoder/
# Create venv and install deps if not already done
ExecStartPre=/bin/bash -c '[ -d ".venv" ] || python3 -m venv .venv'
ExecStartPre=/bin/bash -c 'source .venv/bin/activate && pip install -r requirements.txt'
# Activate venv and run the app
ExecStart=/bin/bash -c 'source .venv/bin/activate && python main.py --port 5001'
Restart=always
Environment="PYTHONUNBUFFERED=1"
StandardOutput=journal
StandardError=journal
SyslogIdentifier=cert-decoder
[Install]
WantedBy=multi-user.target