Skip to content

⚙️ Configuration

🌎 Environment Variables

.env.example:

## --- Environment variable --- ##
ENV=LOCAL
DEBUG=false
# TZ=Asia/Seoul


## -- API configs -- ##
FT_API_PORT=8000
# FT_API_LOGS_DIR="/var/log/rest.fastapi-template"
# FT_API_DATA_DIR="/var/lib/rest.fastapi-template"

# FT_API_VERSION="1"
# FT_API_PREFIX="/api/v{api_version}"
# FT_API_DOCS_ENABLED=true
# FT_API_DOCS_OPENAPI_URL="{api_prefix}/openapi.json"
# FT_API_DOCS_DOCS_URL="{api_prefix}/docs"
# FT_API_DOCS_REDOC_URL="{api_prefix}/redoc"

🔧 Command arguments

You can customize the command arguments to debug or run the service with different commands.

compose.override.yml:

    command: ["/bin/bash"]
    command: ["-b", "pwd && ls -al && /bin/bash"]
    command: ["-b", "python -u -m api"]
    command: ["-b", "uvicorn main:app --host=0.0.0.0 --port=${FT_API_PORT:-8000} --no-access-log --no-server-header --proxy-headers --forwarded-allow-ips='*'"]