fix: have uvicorn use Settings.port and Settings.host

This commit is contained in:
cătălin 2025-03-06 18:49:16 +01:00
commit e6c81a3884
No known key found for this signature in database
7 changed files with 15 additions and 7 deletions

View file

@ -38,7 +38,7 @@ COPY --chown=$USERNAME migrations/ migrations/
FROM base AS serve
CMD ["make", "serve"]
CMD ["uv", "run", "uvicorn", "src.apps.httpapi.litestar.main:app"]
FROM base AS migrate

View file

@ -19,7 +19,7 @@ tests:
uv run coverage xml
serve:
uv run uvicorn src.apps.httpapi.litestar.main:app
uv run python src/apps/httpapi/litestar/main.py
build:
docker build . -t git.roboces.dev/catalin/$(PROJECT_NAME):$(PROJECT_TAG) --target $(PROJECT_TARGET)

View file

@ -1,6 +1,6 @@
apiVersion: v2
appVersion: 0.3.2
appVersion: 0.3.3
description: A Helm chart for Kubernetes
name: huesoporro
type: application
version: 0.3.2
version: 0.3.3

View file

@ -8,7 +8,7 @@ fullnameOverride: ''
image:
pullPolicy: Always
repository: git.roboces.dev/catalin/huesoporro
tag: 0.3.2
tag: 0.3.3
imagePullSecrets: []
ingress:
annotations: {}

View file

@ -1,6 +1,6 @@
[project]
name = "huesoporro"
version = "0.3.2"
version = "0.3.3"
description = "Misc Twitch bot"
readme = "README.md"
authors = [

View file

@ -1,4 +1,5 @@
import httpx
import uvicorn
from litestar import Litestar, get
from litestar.contrib.jinja import JinjaTemplateEngine
from litestar.di import Provide
@ -113,3 +114,10 @@ def create_app():
app = create_app()
if __name__ == "__main__":
s = Settings.get()
config = uvicorn.Config("main:app", host=s.host, port=s.port, log_level="info")
server = uvicorn.Server(config)
server.run()

2
uv.lock generated
View file

@ -517,7 +517,7 @@ wheels = [
[[package]]
name = "huesoporro"
version = "0.3.0"
version = "0.3.3"
source = { editable = "." }
dependencies = [
{ name = "aiosqlite" },