Reviewed-on: #1 Co-authored-by: Gabriel Sancho <gabriel.sancho13@gmail.com> Co-committed-by: Gabriel Sancho <gabriel.sancho13@gmail.com> Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
19
CLAUDE.md
19
CLAUDE.md
@@ -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 | Gitea container registry (`gitea.lab/sancho41/condado-newsletter`) |
|
||||
| CI/CD | Gitea Actions — test PRs to `develop`, build and publish the production image on 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 the prebuilt all-in-one image |
|
||||
| **All-in-one** | `docker run ...` | Simplest deploy — everything in one container |
|
||||
|
||||
### All-in-one Image
|
||||
@@ -104,7 +104,7 @@ The all-in-one image (`Dockerfile.allinone`) bundles **everything** into a singl
|
||||
- **PostgreSQL** — embedded database
|
||||
- **Supervisor** — process manager that starts and supervises all three processes
|
||||
|
||||
The all-in-one image is built locally or in external pipelines as needed (no default registry publish workflow in-repo).
|
||||
The all-in-one image is built on the runner host and then published to the Gitea container registry.
|
||||
|
||||
**Minimal `docker run` command:**
|
||||
```bash
|
||||
@@ -121,7 +121,7 @@ docker run -d \
|
||||
-e IMAP_PORT=993 \
|
||||
-e APP_RECIPIENTS=friend1@example.com,friend2@example.com \
|
||||
-v condado-data:/var/lib/postgresql/data \
|
||||
<registry-or-local-image>/condado-newsletter:latest
|
||||
gitea.lab/sancho41/condado-newsletter:latest
|
||||
```
|
||||
|
||||
The app is then available at `http://localhost`.
|
||||
@@ -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/
|
||||
@@ -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`, then publish `latest` and `${github.sha}` tags to Gitea container registry |
|
||||
|
||||
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 the image locally, tags it for `gitea.lab/sancho41/condado-newsletter`, and pushes it to Gitea container registry. `docker-compose.prod.yml` references that published image.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user