feat(app) lab 3 implemented

This commit is contained in:
imadev
2026-10-30 18:11:30 +03:00
parent f731f9b460
commit 48a616e910
57 changed files with 1390 additions and 303 deletions
+25 -8
View File
@@ -1,9 +1,10 @@
# Copy to .env for your LOCAL synthetic test environment; never commit .env.
# compose.yaml reads these values. Only POSTGRES_PASSWORD is a secret.
# AGENT: Copy to .env for your LOCAL synthetic test environment; never commit
# .env. compose.yaml reads these values. Only POSTGRES_PASSWORD is a secret.
APP_HOST=0.0.0.0
APP_PORT=8080
APP_ENV=lab
SESSION_TTL_SECONDS=3600
IDEMPOTENCY_TTL_SECONDS=86400
DB_POOL_MAX_CONNS=10
# Local PostgreSQL. The API receives a full DATABASE_URL built by compose.yaml.
@@ -11,14 +12,30 @@ POSTGRES_USER=messenger
POSTGRES_PASSWORD=replace-with-a-local-password
POSTGRES_DB=messenger
# Host port for the API. 8081 is used only by the optional short-TTL check.
APP_PORT_PUBLISH=8080
APP_SHORT_TTL_PORT=8081
# Redis is the session store (lab 2 grade 4); PostgreSQL stays the source of
# truth for users, chats, memberships and messages.
# Redis is the shared session store. AOF keeps absolute session TTLs.
SESSION_STORE=redis
# HAProxy is the only public API entrypoint. API replicas use expose, not ports.
LB_PORT=8080
HAPROXY_STATS_PORT=8404
# Per-replica and other services' resource limits.
API_REPLICAS=2
API_CPU_LIMIT=0.50
API_MEM_LIMIT=256M
POSTGRES_CPU_LIMIT=1.0
POSTGRES_MEM_LIMIT=512M
REDIS_CPU_LIMIT=0.50
REDIS_MEM_LIMIT=256M
HAPROXY_CPU_LIMIT=0.50
HAPROXY_MEM_LIMIT=128M
# K6 for detailed tests
K6_VUS=10
K6_DURATION=60
K6_CPU_LIMIT=1.0
K6_MEM_LIMIT=512M
# Optional overrides instead of the compose-generated URLs. A *_FILE value is
# read from a file, which is how Docker/Compose secrets are usually mounted.
# DATABASE_URL=postgres://messenger:password@localhost:5432/messenger?sslmode=disable