Skip to content

Commit 36afbe2

Browse files
baijumclaude
andcommitted
docs: fix deployment ordering and add __init__.py to spec
- Fix migration diagram: runs after container starts, not before - Add -c app/alembic.ini flag to migration command - Add __init__.py to repository structure tree Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 993751d commit 36afbe2

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

docs/deployment.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ If the health check fails, traffic stays on the previous version.
7878
7979
## Database Migrations
8080
81-
Migrations run automatically as part of the deployment pipeline, **before** the new application container starts.
81+
Migrations run automatically as part of the deployment pipeline, **after the application container starts, by executing alembic inside the running container**.
8282
8383
```
8484
Deploy started
8585
8686
87-
Run database migrations
87+
Start containers
8888
8989
90-
Start new application container
90+
Run migrations (inside container)
9191
9292
9393
Health check
@@ -96,7 +96,7 @@ Health check
9696
Migration command:
9797

9898
```bash
99-
docker compose exec app alembic upgrade head
99+
docker compose exec app alembic -c app/alembic.ini upgrade head
100100
```
101101

102102
### Safe Migration Rules

docs/spec.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Each application lives in its own GitHub repository under the `towlion` organiza
2020
```
2121
repo/
2222
app/ # FastAPI backend
23+
__init__.py # Package marker (required)
2324
Dockerfile # Backend container image
2425
main.py # Application entry point
2526
frontend/ # Next.js frontend (optional)

0 commit comments

Comments
 (0)