feat: update Docker configuration and CI/CD workflows for local image builds
This commit is contained in:
13
CLAUDE.md
13
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 | 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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user