Commit 86d968b
committed
chore: fix Docker Compose PostgreSQL 18 compatibility and health checks
DOCKER COMPOSE FIXES (docker-compose.yml):
- Removed obsolete 'version' attribute (Docker Compose 2.x compatibility)
- PostgreSQL 18 volume path: /var/lib/postgresql/data -> /var/lib/postgresql
* Fixes data directory incompatibility with PostgreSQL 18+ pg_ctlcluster format
* Reference: docker-library/postgres#1259
- Added healthcheck for db service: pg_isready -U app -d kolb (5s interval, 3s timeout, 5 retries)
- Updated api depends_on with condition: service_healthy (prevents startup before DB ready)
WEB PACKAGE LOCK (web/package-lock.json):
- Regenerated lock file to sync with updated package.json (Express 4.21.1 -> 5.1.0)
- Fixes npm ci error: Invalid lock file mismatch
- All 68 packages installed with 0 vulnerabilities
DATABASE SCHEMA APPLICATION:
- Applied schema.sql via stdin: Get-Content db/schema.sql | psql -U app -d kolb
- Successfully created 13 tables: users, cohorts, students, instruments, items, responses, factor_scores, interventions, rewards, bandit_events, resistance_predictions, mediator_trainings, notes
- Verified with dt command: all tables owned by app user
API STARTUP VERIFICATION:
- DB Connection pool initialized (asyncpg) log confirmed
- Health endpoint: GET http://localhost:8000/health -> status:ok (200 OK)
- Uvicorn running on http://0.0.0.0:8000
ACADEMIC RATIONALE:
- Health checks: ensure graceful startup order (Fowler, 2015: Microservices Patterns)
- PostgreSQL 18 upgrade path: follows official Docker Library migration guidelines
- Dependency orchestration: prevents race conditions in distributed system startup
REFERENCES:
- Docker Compose Health Check: https://docs.docker.com/compose/how-tos/startup-order/
- PostgreSQL 18 Breaking Changes: docker-library/postgres#1259
- Fowler, M. (2015) Microservices Resource Guide
DEPLOYMENT STATUS:
- All services running: api, web, db, redis
- Database schema applied (13 tables, indexes, FK constraints)
- API connected to PostgreSQL via asyncpg
- System ready for endpoint development1 parent bc05288 commit 86d968b
2 files changed
+835
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
0 commit comments