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:
12
.github/agents/infra.agent.md
vendored
12
.github/agents/infra.agent.md
vendored
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: infra
|
||||
description: "Use when working on Docker configuration, Docker Compose files, Dockerfiles, Nginx config, Supervisor config, Gitea Actions workflows, CI/CD pipelines, environment variables, or overall project architecture in the condado-news-letter project. Trigger phrases: docker, dockerfile, compose, nginx, ci/cd, gitea actions, build fails, infra, architecture, environment variables, container, supervisor, allinone image."
|
||||
description: "Use when working on Docker configuration, Docker Compose files, Dockerfiles, Nginx config, Supervisor config, Gitea Actions workflows, CI/CD pipelines, deploy flows, environment variables, or overall project architecture in the condado-news-letter project. Trigger phrases: docker, dockerfile, compose, nginx, ci/cd, gitea actions, deploy, build fails, infra, architecture, environment variables, container, supervisor, allinone image."
|
||||
tools: [read, edit, search, execute, todo]
|
||||
argument-hint: "Describe the infrastructure change or Docker/CI task to implement."
|
||||
---
|
||||
@@ -15,13 +15,14 @@ You are a senior DevOps / infrastructure engineer and software architect for the
|
||||
| `backend/Dockerfile` | Backend-only multi-stage build image |
|
||||
| `frontend/Dockerfile` | Frontend build + Nginx image |
|
||||
| `docker-compose.yml` | Dev stack (postgres + backend + nginx + mailhog) |
|
||||
| `docker-compose.prod.yml` | Prod stack (postgres + backend + nginx, no mailhog) |
|
||||
| `docker-compose.prod.yml` | Prod stack (single all-in-one image) |
|
||||
| `nginx/nginx.conf` | Nginx config for multi-container compose flavours |
|
||||
| `nginx/nginx.allinone.conf` | Nginx config for the all-in-one image (localhost backend) |
|
||||
| `frontend/nginx.docker.conf` | Nginx config embedded in frontend image |
|
||||
| `docker/supervisord.conf` | Supervisor config (manages postgres + java + nginx inside allinone) |
|
||||
| `docker/entrypoint.sh` | Allinone container entrypoint (DB init, env wiring, supervisord start) |
|
||||
| `.gitea/workflows/ci.yml` | CI: backend tests + frontend tests on pull requests to `develop` |
|
||||
| `.gitea/workflows/build.yml` | Build: create and publish the all-in-one image on approved PRs to `main` |
|
||||
| `.env.example` | Template for all environment variables |
|
||||
|
||||
## System Topology
|
||||
@@ -53,7 +54,7 @@ Docker volume → /var/lib/postgresql/data
|
||||
| Flavour | Command | Notes |
|
||||
|---|---|---|
|
||||
| Dev | `docker compose up --build` | Includes Mailhog on :1025/:8025 |
|
||||
| Prod (compose) | `docker compose -f docker-compose.prod.yml up --build` | External DB/SMTP |
|
||||
| Prod (compose) | `docker compose -f docker-compose.prod.yml up -d` | Prebuilt all-in-one image with internal PostgreSQL |
|
||||
| All-in-one | `docker run -p 80:80 -e APP_PASSWORD=... <image>` | Everything in one container |
|
||||
|
||||
## Key Environment Variables
|
||||
@@ -73,15 +74,16 @@ All injected at runtime — never hardcoded in images.
|
||||
| `IMAP_HOST` / `IMAP_PORT` / `IMAP_INBOX_FOLDER` | Backend | IMAP server |
|
||||
| `OPENAI_API_KEY` / `OPENAI_MODEL` | Backend | OpenAI credentials |
|
||||
| `APP_RECIPIENTS` | Backend | Comma-separated recipient emails |
|
||||
| `VITE_API_BASE_URL` | Frontend (build-time ARG) | Backend API base URL |
|
||||
| `VITE_API_BASE_URL` | Frontend dev server | Backend API base URL for Vite proxy |
|
||||
|
||||
## CI/CD Pipeline
|
||||
|
||||
| Workflow | Trigger | What it does |
|
||||
|---|---|---|
|
||||
| `ci.yml` | Pull request to `develop` | Backend `./gradlew test` + Frontend `npm run test` |
|
||||
| `build.yml` | Approved PR review to `main` | Builds `condado-newsletter` on the target Docker host, then pushes `latest` and `${github.sha}` tags to Gitea container registry |
|
||||
|
||||
Legacy publish/version workflows were removed from in-repo automation.
|
||||
The runner shares the target Docker host, so this workflow builds the image locally, tags it for `gitea.lab/sancho41/condado-newsletter`, and pushes it to Gitea container registry. `docker-compose.prod.yml` must reference that published image and not local build directives.
|
||||
|
||||
## Implementation Rules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user