🔧 enhance Makefile and Readme with Docker Swarm and Kubernetes support, adding new targets for deployment and management
This commit is contained in:
38
Readme.md
38
Readme.md
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user