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

This commit is contained in:
cătălin 2025-03-06 19:44:44 +01:00
commit 95101a6573
No known key found for this signature in database
8 changed files with 28 additions and 7 deletions

View file

@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file.
## [unreleased]
### 🐛 Bug Fixes
- Have uvicorn use Settings.port and Settings.host
## [0.3.2] - 2025-03-06
### ⚙️ Miscellaneous Tasks
- Update charts to v0.3.2
## [0.3.1] - 2025-03-06
### 🐛 Bug Fixes

View file

@ -16,7 +16,7 @@ ENV PYTHONPATH="$APP_PATH"
ENV PATH="$APP_HOME/.local/bin:$PATH"
# hadolint ignore=DL3001,DL3008,DL3018
RUN apk add --no-cache make python3~=3.12 \
RUN apk add --no-cache make python3~=3.12 curl \
&& adduser -S -u "$USERID" -h "$APP_HOME" "$USERNAME" \
&& mkdir -p "$APP_PATH" \
&& chown -R "$USERID:$GROUPID" "$APP_PATH"
@ -40,6 +40,7 @@ FROM base AS serve
CMD ["make", "serve"]
FROM base AS migrate
CMD ["make", "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.port, 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" },