🔧 enhance Makefile and Readme with Docker Swarm and Kubernetes support, adding new targets for deployment and management
All checks were successful
CI / Lint (push) Successful in 21s
CI / Helm Lint (push) Successful in 5s
CI / Build (push) Successful in 1m48s
CI / Test (push) Successful in 44s

This commit is contained in:
Christian van Dijk
2026-02-23 23:30:20 +01:00
parent 0a78491587
commit d7562d8a30
5 changed files with 247 additions and 8 deletions

View File

@@ -79,14 +79,14 @@ make lint # deno check
From project root:
| Target | Description |
| --------------------- | ----------------------------------------- |
| Target | Description |
| --------------------- | ------------------------------------------ |
| `make install-deps` | Install LuaRocks + Deno deps for local dev |
| `make dev` | Start all services |
| `make down` | Stop all services |
| `make build` | Build Docker images |
| `make test` | Run API unit tests |
| `make lint` | Luacheck + Deno check |
| `make dev` | Start all services |
| `make down` | Stop all services |
| `make build` | Build Docker images |
| `make test` | Run API unit tests |
| `make lint` | Luacheck + Deno check |
| `make logs` | Follow API logs |
| `make logs-worker` | Follow worker logs |
| `make init-db` | Run DB migrations manually |
@@ -110,6 +110,30 @@ From project root:
- **Kubernetes**: `helm lint k8s/handheld-devices`
- **CI**: See `.github/workflows/ci.yml` (lint, build, unit tests, helm lint)
## Docker Swarm
Use `compose.swarm.yml` to deploy to Docker Swarm. Postgres is pinned to a single node (via label) so its volume stays on one node.
**Label the node** that will run Postgres before deploying:
```bash
docker node ls
docker node update --label-add db=true <NODE_ID>
```
Then deploy:
```bash
docker swarm init # if not already a swarm manager
make swarm-deploy
```
| Target | Description |
| ------------------- | ------------------------------ |
| `make swarm-build` | Build and tag images for Swarm |
| `make swarm-deploy` | Build images and deploy stack |
| `make swarm-down` | Remove stack from Swarm |
## Environment
See `.env.example` for configuration. Key variables: