Override-based compose, profiles in .env, README

This commit is contained in:
hh
2026-09-09 00:18:15 +02:00
parent 1f416dbe60
commit ac0ccf47e5
13 changed files with 131 additions and 88 deletions
@@ -10,8 +10,8 @@ from fastapi.middleware.cors import CORSMiddleware
from api import routers
{% if use_dishka %}from dependencies.container import container
{% endif %}{% if database != 'none' %}from utils.db import init_db
{% endif %}{% if serve_spa %}from utils.env import env
{% endif %}from utils.logging import setup_logging
{% endif %}from utils.env import env
from utils.logging import setup_logging
{% if serve_spa %}
IMMUTABLE_HEADERS = {"Cache-Control": "public, max-age=31536000, immutable"}
NO_CACHE_HEADERS = {"Cache-Control": "no-cache"}
@@ -29,7 +29,11 @@ async def lifespan(app_: FastAPI) -> AsyncGenerator[None]:
{%- endif %}
app = FastAPI(title="{{ project_name }} API", lifespan=lifespan)
app = FastAPI(
title="{{ project_name }} API",
lifespan=lifespan,
openapi_url="/openapi.json" if env.api.docs else None,
)
app.add_middleware(
CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"]