feat: update Docker configuration and CI/CD workflows for local image builds
Some checks failed
CI / Backend Tests (pull_request) Failing after 11m8s
CI / Frontend Tests (pull_request) Has been cancelled

This commit is contained in:
2026-03-27 16:01:34 -03:00
parent 06112330b6
commit 3f0bb4be73
5 changed files with 41 additions and 19 deletions

View File

@@ -83,8 +83,8 @@ The cycle for every step is:
| Reverse Proxy | Nginx (serves frontend + proxies `/api` to backend) |
| Dev Mail | Mailhog (SMTP trap + web UI) |
| All-in-one image | Single Docker image: Nginx + Spring Boot + PostgreSQL + Supervisor |
| Image registry | Not configured (legacy Docker Hub publish workflow removed) |
| CI/CD | Gitea Actions — run backend/frontend tests on pull requests to `develop` |
| Image registry | Local Docker images on the deployment host (`condado-newsletter-backend`, `condado-newsletter-frontend`) |
| CI/CD | Gitea Actions — test PRs to `develop`, deploy approved PRs targeting `main` |
## Deployment Flavours
@@ -93,7 +93,7 @@ There are **three ways to run the project**:
| Flavour | Command | When to use |
|---------------------|---------------------------------|------------------------------------------------|
| **Dev** | `docker compose up` | Local development — includes Mailhog |
| **Prod (compose)** | `docker compose -f docker-compose.prod.yml up` | Production with external DB/SMTP |
| **Prod (compose)** | `docker compose -f docker-compose.prod.yml up -d` | Production with prebuilt backend/frontend images |
| **All-in-one** | `docker run ...` | Simplest deploy — everything in one container |
### All-in-one Image
@@ -312,7 +312,7 @@ npm run test
docker compose up --build
# Prod
docker compose -f docker-compose.prod.yml up --build
docker compose -f docker-compose.prod.yml up -d
# Stop
docker compose down
@@ -456,7 +456,7 @@ Never hardcode any of these values.
| `OPENAI_API_KEY` | Backend | OpenAI API key |
| `OPENAI_MODEL` | Backend | OpenAI model (default: `gpt-4o`) |
| `APP_RECIPIENTS` | Backend | Comma-separated list of recipient emails |
| `VITE_API_BASE_URL` | Frontend | Backend API base URL (used by Vite at build time) |
| `VITE_API_BASE_URL` | Frontend | Backend API base URL for the Vite dev server proxy |
> ⚠️ Never hardcode credentials. Always use environment variables or a `.env` file (gitignored).
@@ -575,8 +575,9 @@ Good examples:
| Workflow file | Trigger | What it does |
|----------------------------|----------------------------|-----------------------------------------------------------|
| `.gitea/workflows/ci.yml` | PR to `develop` | Backend tests (`./gradlew test`) + Frontend tests (`npm run test`) |
| `.gitea/workflows/build.yml` | Approved PR review on `main` | Build `condado-newsletter-backend` and `condado-newsletter-frontend` locally on the runner host |
Current policy: old publish/version automation workflows were removed during the Gitea migration.
Build policy: the runner shares the target Docker host, so the build workflow produces local Docker images directly on that host. `docker-compose.prod.yml` is image-based and can be started separately without build directives.
---