Add systemd service and switch app to port 80

Add c2.service unit to run the FastAPI app as workshop-c2. The unit
invokes uv via /usr/bin/env, sets PATH and PYTHONUNBUFFERED, enables
automatic restarts with a short backoff, and logs to the journal using
SyslogIdentifier. Also update main.py's runtime invocation
This commit is contained in:
Stefan Kempinger 2025-11-05 16:59:37 +01:00
parent 3ea31027f1
commit 38e46a3c50
2 changed files with 29 additions and 1 deletions

View file

@ -108,4 +108,4 @@ async def root():
if __name__ == "__main__":
# Run with: python main.py
uvicorn.run("main:app", host="0.0.0.0", port=8000, log_level="info")
uvicorn.run("main:app", host="0.0.0.0", port=80, log_level="info")