From 757bb2dc53a9d8fae294606d364e9a48c82768d7 Mon Sep 17 00:00:00 2001 From: grillazz Date: Sun, 8 Jun 2025 20:00:19 +0200 Subject: [PATCH 1/2] fix granian-compose.yml --- Dockerfile | 5 +++-- compose.yml | 2 ++ granian-compose.yml | 18 +++++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f7ee58..e028a1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,9 +54,10 @@ COPY /app/ app/ COPY /tests/ tests/ COPY /templates/ templates/ COPY .env app/ -COPY alembic.ini app/ -COPY alembic/ app/alembic/ +COPY alembic.ini /panettone/alembic.ini +COPY /alembic/ alembic/ COPY logging-uvicorn.json /panettone/logging-uvicorn.json +COPY logging-granian.json /panettone/logging-granian.json COPY pyproject.toml /panettone/pyproject.toml RUN python -V diff --git a/compose.yml b/compose.yml index b16d09a..9f74f4c 100644 --- a/compose.yml +++ b/compose.yml @@ -3,6 +3,8 @@ services: container_name: fsap_app network_mode: host build: . + environment: + - PYTHONPATH=/panettone env_file: - .env - .secrets diff --git a/granian-compose.yml b/granian-compose.yml index 1a94eda..40e285c 100644 --- a/granian-compose.yml +++ b/granian-compose.yml @@ -1,21 +1,32 @@ services: app: container_name: fsap_app + network_mode: host build: . + environment: + - PYTHONPATH=/panettone env_file: - .env - .secrets - command: granian --interface asgi --host 0.0.0.0 --port 8080 --loop uvloop app.main:app --access-log --log-level debug --log-config ./logging-granian.json + command: bash -c " + granian --interface asgi + --host 0.0.0.0 --port 8080 + app.main:app --access-log --log-level debug + --log-config ./logging-granian.json + " volumes: - - .:/home/code + - ./app:/panettone/app + - ./tests:/panettone/tests + - ./templates:/panettone/templates ports: - "8080:8080" depends_on: - db - - redis + - inmemory db: container_name: fsap_db + network_mode: host build: context: ./db dockerfile: Dockerfile @@ -41,6 +52,7 @@ services: inmemory: image: redis:latest container_name: fsap_inmemory + network_mode: host ports: - "6379:6379" env_file: From 7499337e02ba3903ea95e20489d52ee4123e875c Mon Sep 17 00:00:00 2001 From: Ordinary Hobbit Date: Sun, 8 Jun 2025 20:10:44 +0200 Subject: [PATCH 2/2] Update Dockerfile Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e028a1b..6161448 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,7 +55,7 @@ COPY /tests/ tests/ COPY /templates/ templates/ COPY .env app/ COPY alembic.ini /panettone/alembic.ini -COPY /alembic/ alembic/ +COPY /alembic/ /panettone/alembic/ COPY logging-uvicorn.json /panettone/logging-uvicorn.json COPY logging-granian.json /panettone/logging-granian.json COPY pyproject.toml /panettone/pyproject.toml