refactor: update build process to create a single all-in-one Docker image and adjust related configurations
Some checks failed
CI / Frontend Tests (pull_request) Has been cancelled
CI / Backend Tests (pull_request) Has been cancelled

This commit is contained in:
2026-03-27 16:10:14 -03:00
parent 3f0bb4be73
commit 6305a8e95e
6 changed files with 42 additions and 64 deletions

View File

@@ -83,7 +83,7 @@ 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 | Local Docker images on the deployment host (`condado-newsletter-backend`, `condado-newsletter-frontend`) |
| Image registry | Local Docker image on the deployment host (`condado-newsletter`) |
| 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 -d` | Production with prebuilt backend/frontend images |
| **Prod (compose)** | `docker compose -f docker-compose.prod.yml up -d` | Production with the prebuilt all-in-one image |
| **All-in-one** | `docker run ...` | Simplest deploy — everything in one container |
### All-in-one Image
@@ -213,7 +213,7 @@ condado-news-letter/ ← repo root
├── .env.example ← template for all env vars
├── .gitignore
├── docker-compose.yml ← dev stack (Nginx + Backend + PostgreSQL + Mailhog)
├── docker-compose.prod.yml ← prod stack (Nginx + Backend + PostgreSQL)
├── docker-compose.prod.yml ← prod stack (single all-in-one image)
├── Dockerfile.allinone ← all-in-one image (Nginx + Backend + PostgreSQL + Supervisor)
├── .github/
@@ -575,9 +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 |
| `.gitea/workflows/build.yml` | Approved PR review on `main` | Build `condado-newsletter` locally on the runner host |
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.
Build policy: the runner shares the target Docker host, so the build workflow produces the local `condado-newsletter` image directly on that host. `docker-compose.prod.yml` is image-based and can be started separately without build directives.
---