Skip to content

Deployment

GitLab CI/CD

The pipeline is configured in .gitlab-ci.yml and triggers on semver tags (1.0.0, 1.2.3, etc.).

Steps

  1. Multi-arch build: Docker images for linux/amd64 and linux/arm64 via docker buildx
  2. Push to Docker Hub: version tag + latest

Docker Images

ImageDescription
cletus/caddy-manager-apiBackend API
cletus/caddy-manager-uiFrontend (Nginx)
cletus/cadmin-agentAgent

Trigger a Deployment

bash
git tag 1.2.0
git push origin 1.2.0

Updating the Hub

bash
docker compose pull
docker compose up -d

# If migrations are needed
docker compose exec caddy-manager-api node dist/db/migrate.js

Updating Agents

On each remote server:

bash
docker compose pull cadmin-agent
docker compose up -d cadmin-agent

Agents are stateless, restart is seamless.

Rollback

Application

Specify the previous version tag in docker-compose.yml and restart:

bash
docker compose down
# Change to image: cletus/caddy-manager-api:1.1.0
docker compose up -d

Caddy Configuration

Configuration rollback is automatic: if Caddy rejects the new configuration, the database modification is reverted and the previous configuration remains active.