diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 2d0b14d..7b5a145 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -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: @@ -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: diff --git a/Dockerfile b/Dockerfile index c508e3a..6a8b099 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,3 @@ COPY ./alembic.ini /alembic.ini COPY ./migrations /migrations/ COPY ./${APP_NAME} /app/${APP_NAME} - - - diff --git a/social/routes/base.py b/social/routes/base.py index eab4d7d..0b7aaad 100644 --- a/social/routes/base.py +++ b/social/routes/base.py @@ -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, ) diff --git a/social/settings.py b/social/settings.py index 9902f05..0bf870f 100644 --- a/social/settings.py +++ b/social/settings.py @@ -1,3 +1,5 @@ +import os + from pydantic import BaseSettings, PostgresDsn from functools import lru_cache @@ -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