Add "latest" integer table in database & switch to blue-green deployment strategy; add migration script #37

Merged
marfavi merged 10 commits from migration into main 2026-03-11 19:27:38 +01:00
Owner

Fixes #30
Fixes #16

Fixes #30 Fixes #16
Previously the deploy script stopped the running container before
starting the new one, causing downtime on every deploy.

Changes:
- docker-compose.yml: remove container_name (required for two parallel stacks), bind ports to 127.0.0.1 only, add healthcheck
- docker-compose.test.yml: move test port from 5002 → 5003 to avoid collision with the green stack
- Makefile: add blue/green variants of run and stop targets
- deploy.sh: replace stop-then-start with a full blue-green cutover
- add default nginx config files
- deploy/README.md: document Nginx install
Add migration.typ documenting the migration plan and deployment stack, and write a script that follows this plan (migrate.sh). Remove initial migration logic from deploy.sh.

deploy.sh now requires nginx to already be running (via migrate.sh) and only handles blue-green switching.

- Add migrate.sh with pre-flight checks, cleanup trap, and health verification via /api/health/live
- Simplify deploy.sh by cleaning up comments
- Update README.md to reference migrate.sh
balthazar approved these changes 2026-03-10 14:08:37 +01:00
balthazar left a comment

Good structuring with functions.

Good with piping into nothing for clean output

I was a bit stumped by choice of port 8080, but ultimately it is just another temporary port for the healthcheck, maybe some docs on that and how nginx listens to that.

There are some changes to things other than migration and deployment that confuses me, and maybe should have been split out into another PR as this one is already quite big.

Ultimately, LGTM 🚀

Good structuring with functions. Good with piping into nothing for clean output I was a bit stumped by choice of port 8080, but ultimately it is just another temporary port for the healthcheck, maybe some docs on that and how nginx listens to that. There are some changes to things other than migration and deployment that confuses me, and maybe should have been split out into another PR as this one is already quite big. Ultimately, LGTM 🚀
marfavi deleted branch migration 2026-03-11 19:27:39 +01:00
Commenting is not possible because the repository is archived.
No reviewers
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
DevOpps/minitwit!37
No description provided.