Skip to content

Commit

Permalink
root_path for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakovri committed Mar 12, 2023
1 parent 5363682 commit 68ac0d3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
runs-on: [self-hosted, Linux]
environment:
name: Testing
url: https://social.api.test.profcomff.com/
url: https://api.test.profcomff.com/social
env:
CONTAITER_NAME: com_profcomff_api_social_test
permissions:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
runs-on: [self-hosted, Linux]
environment:
name: Production
url: https://social.api.profcomff.com/
url: https://api.profcomff.com/social
env:
CONTAITER_NAME: com_profcomff_api_social
permissions:
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ COPY ./alembic.ini /alembic.ini
COPY ./migrations /migrations/

COPY ./${APP_NAME} /app/${APP_NAME}



3 changes: 2 additions & 1 deletion social/routes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
),
version=__version__,

# Отключаем нелокальную документацию
# Настраиваем интернет документацию
root_path=settings.ROOT_PATH if __version__ != 'dev' else '/',
docs_url=None if __version__ != 'dev' else '/docs',
redoc_url=None,
)
Expand Down
3 changes: 3 additions & 0 deletions social/settings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from pydantic import BaseSettings, PostgresDsn
from functools import lru_cache

Expand All @@ -6,6 +8,7 @@ class Settings(BaseSettings):
"""Application settings"""

DB_DSN: PostgresDsn
ROOT_PATH: str = '/' + os.getenv("APP_NAME")

CORS_ALLOW_ORIGINS: list[str] = ['*']
CORS_ALLOW_CREDENTIALS: bool = True
Expand Down

0 comments on commit 68ac0d3

Please sign in to comment.