Initial commit
Some checks failed
Run linters on applied template / Python 3.13 lint and build (push) Failing after 42s

This is a FastAPI backend microservice template used with `copier` utility.

Features of applied template are:
- Configuration file processing logic
- Metrics and tracing (both optional) configuration available
- Debug endpoints
- Database migration commands, prepared Alembic environment
- Database usage example in ping_db endpoint
- gitea sanity check pipeline
This commit is contained in:
2025-11-29 21:42:27 +03:00
commit 30c354d308
52 changed files with 4562 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
app:
host: 0.0.0.0
port: 8080
debug: true
cors:
allow_origins: ["*"]
allow_methods: ["*"]
allow_headers: ["*"]
allow_credentials: True
db:
master:
host: {{project_slug}}_db
port: 5432
database: {{project_slug}}_db
user: postgres
password: postgres
pool_size: 2
logging:
level: INFO
observability:
prometheus:
host: 0.0.0.0
port: 9090
urls_mapping:
/api/debug/.*: /api/debug/*
jaeger:
endpoint: http://otel:4318/v1/traces

View File

@@ -0,0 +1,30 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
otlp/jaeger:
endpoint: "http://jaeger:4317"
tls:
insecure: true
debug:
verbosity: detailed
processors:
batch:
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug, otlp/jaeger]
metrics:
receivers: [otlp]
exporters: [debug]
logs:
receivers: [otlp]
exporters: [debug]

View File

@@ -0,0 +1,13 @@
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: prometheus
static_configs:
- targets:
- "localhost:9090"
- job_name: {{project_name}}
static_configs:
- targets:
- "{{project_name}}:9090"