feat: publish Swarm images to Gitea registry
Some checks failed
CI / Validate frontend and API (push) Successful in 29s
CI / Build and publish Docker images (push) Failing after 5s

This commit is contained in:
Cauê Faleiros
2026-08-31 13:35:53 -03:00
parent 4932f6bf04
commit 7a18251916
4 changed files with 48 additions and 17 deletions

View File

@@ -2,6 +2,8 @@
Use `docker-compose.yml` as a Portainer Stack from this repository. It deploys the frontend, API, and PostgreSQL as one internal Docker network. Only the web container exposes a port; it proxies `/api` to the API container.
This is a Docker Swarm stack: Portainer pulls prebuilt API and web images from the Gitea Container Registry. It never builds Dockerfiles itself.
## Required Portainer environment variables
- `POSTGRES_PASSWORD`: a long, unique database password. Avoid characters that are not URL-safe because it is used in `DATABASE_URL`.
@@ -13,12 +15,16 @@ Optional variables:
- `POSTGRES_DB` (default `compor_hub`)
- `POSTGRES_USER` (default `compor`)
- `WEB_PORT` (default `8080`)
- `IMAGE_TAG` (default `latest`; set a specific release tag when available)
- `API_IMAGE` and `WEB_IMAGE` only if the Gitea registry namespace differs from the defaults.
## Before publishing
1. Deploy the stack with a temporary `WEB_PORT` and verify `/api/v1/health` through the public domain.
2. Create the production administrator using the API container's console and `npm run db:bootstrap-admin`, with the `BOOTSTRAP_ADMIN_*` variables supplied only for that one command.
3. Place the web service behind HTTPS, normally through your existing reverse proxy (Traefik, Nginx Proxy Manager, or Cloudflare Tunnel), and set `FRONTEND_ORIGIN` to that HTTPS address.
4. Back up the `compor_postgres_data` volume before updates.
1. Push to `main` and wait for Gitea Actions to publish `gitea.blyzer.com.br/blyzer/compor-academy-api:latest` and `gitea.blyzer.com.br/blyzer/compor-academy-web:latest`.
2. Ensure the Portainer endpoint can pull from the Gitea Container Registry. If the images are private, add Gitea registry credentials to the endpoint/stack deployment configuration.
3. Deploy the stack with a temporary `WEB_PORT` and verify `/api/v1/health` through the public domain.
4. Create the production administrator using the API container's console and `npm run db:bootstrap-admin`, with the `BOOTSTRAP_ADMIN_*` variables supplied only for that one command.
5. Place the web service behind HTTPS, normally through your existing reverse proxy (Traefik, Nginx Proxy Manager, or Cloudflare Tunnel), and set `FRONTEND_ORIGIN` to that HTTPS address.
6. Back up the `compor_postgres_data` volume before updates.
Do not expose port 5432 or port 3001 publicly.