feature/testing #3
@@ -33,5 +33,5 @@ LLAMA_MODEL=gemma3:4b
|
|||||||
# ── Application ───────────────────────────────────────────────────────────────
|
# ── Application ───────────────────────────────────────────────────────────────
|
||||||
APP_RECIPIENTS=friend1@example.com,friend2@example.com
|
APP_RECIPIENTS=friend1@example.com,friend2@example.com
|
||||||
|
|
||||||
# ── Frontend (Vite build-time) ────────────────────────────────────────────────
|
# ── Frontend (Vite dev proxy) ─────────────────────────────────────────────────
|
||||||
VITE_API_BASE_URL=http://localhost
|
VITE_API_BASE_URL=http://localhost
|
||||||
|
|||||||
38
.gitea/workflows/build.yml
Normal file
38
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Build And Publish Production Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_review:
|
||||||
|
types: [submitted]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build And Publish Production Image
|
||||||
|
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'main'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
REGISTRY: gitea.lab
|
||||||
|
IMAGE_NAME: sancho41/condado-newsletter
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
github-server-url: http://gitea.lab
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- name: Verify Docker CLI
|
||||||
|
run: docker version
|
||||||
|
|
||||||
|
- name: Build all-in-one image
|
||||||
|
run: docker build -t condado-newsletter:latest -f Dockerfile.allinone .
|
||||||
|
|
||||||
|
- name: Log in to Gitea container registry
|
||||||
|
run: echo "${{ secrets.GITEA_REGISTRY_PASSWORD }}" | docker login ${REGISTRY} -u "${{ secrets.GITEA_REGISTRY_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Tag registry images
|
||||||
|
run: |
|
||||||
|
docker tag condado-newsletter:latest ${REGISTRY}/${IMAGE_NAME}:latest
|
||||||
|
docker tag condado-newsletter:latest ${REGISTRY}/${IMAGE_NAME}:${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Push registry images
|
||||||
|
run: |
|
||||||
|
docker push ${REGISTRY}/${IMAGE_NAME}:latest
|
||||||
|
docker push ${REGISTRY}/${IMAGE_NAME}:${{ github.sha }}
|
||||||
@@ -13,6 +13,8 @@ jobs:
|
|||||||
working-directory: backend
|
working-directory: backend
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
github-server-url: http://gitea.lab
|
||||||
|
|
||||||
- name: Set up JDK 21
|
- name: Set up JDK 21
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
@@ -42,6 +44,8 @@ jobs:
|
|||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
github-server-url: http://gitea.lab
|
||||||
|
|
||||||
- name: Set up Node 20
|
- name: Set up Node 20
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
|||||||
12
.github/agents/infra.agent.md
vendored
12
.github/agents/infra.agent.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: infra
|
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]
|
tools: [read, edit, search, execute, todo]
|
||||||
argument-hint: "Describe the infrastructure change or Docker/CI task to implement."
|
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 |
|
| `backend/Dockerfile` | Backend-only multi-stage build image |
|
||||||
| `frontend/Dockerfile` | Frontend build + Nginx image |
|
| `frontend/Dockerfile` | Frontend build + Nginx image |
|
||||||
| `docker-compose.yml` | Dev stack (postgres + backend + nginx + mailhog) |
|
| `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.conf` | Nginx config for multi-container compose flavours |
|
||||||
| `nginx/nginx.allinone.conf` | Nginx config for the all-in-one image (localhost backend) |
|
| `nginx/nginx.allinone.conf` | Nginx config for the all-in-one image (localhost backend) |
|
||||||
| `frontend/nginx.docker.conf` | Nginx config embedded in frontend image |
|
| `frontend/nginx.docker.conf` | Nginx config embedded in frontend image |
|
||||||
| `docker/supervisord.conf` | Supervisor config (manages postgres + java + nginx inside allinone) |
|
| `docker/supervisord.conf` | Supervisor config (manages postgres + java + nginx inside allinone) |
|
||||||
| `docker/entrypoint.sh` | Allinone container entrypoint (DB init, env wiring, supervisord start) |
|
| `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/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 |
|
| `.env.example` | Template for all environment variables |
|
||||||
|
|
||||||
## System Topology
|
## System Topology
|
||||||
@@ -53,7 +54,7 @@ Docker volume → /var/lib/postgresql/data
|
|||||||
| Flavour | Command | Notes |
|
| Flavour | Command | Notes |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Dev | `docker compose up --build` | Includes Mailhog on :1025/:8025 |
|
| 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 |
|
| All-in-one | `docker run -p 80:80 -e APP_PASSWORD=... <image>` | Everything in one container |
|
||||||
|
|
||||||
## Key Environment Variables
|
## 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 |
|
| `IMAP_HOST` / `IMAP_PORT` / `IMAP_INBOX_FOLDER` | Backend | IMAP server |
|
||||||
| `OPENAI_API_KEY` / `OPENAI_MODEL` | Backend | OpenAI credentials |
|
| `OPENAI_API_KEY` / `OPENAI_MODEL` | Backend | OpenAI credentials |
|
||||||
| `APP_RECIPIENTS` | Backend | Comma-separated recipient emails |
|
| `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
|
## CI/CD Pipeline
|
||||||
|
|
||||||
| Workflow | Trigger | What it does |
|
| Workflow | Trigger | What it does |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `ci.yml` | Pull request to `develop` | Backend `./gradlew test` + Frontend `npm run test` |
|
| `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
|
## Implementation Rules
|
||||||
|
|
||||||
|
|||||||
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) |
|
| Reverse Proxy | Nginx (serves frontend + proxies `/api` to backend) |
|
||||||
| Dev Mail | Mailhog (SMTP trap + web UI) |
|
| Dev Mail | Mailhog (SMTP trap + web UI) |
|
||||||
| All-in-one image | Single Docker image: Nginx + Spring Boot + PostgreSQL + Supervisor |
|
| All-in-one image | Single Docker image: Nginx + Spring Boot + PostgreSQL + Supervisor |
|
||||||
| Image registry | Not configured (legacy Docker Hub publish workflow removed) |
|
| Image registry | Gitea container registry (`gitea.lab/sancho41/condado-newsletter`) |
|
||||||
| CI/CD | Gitea Actions — run backend/frontend tests on pull requests to `develop` |
|
| CI/CD | Gitea Actions — test PRs to `develop`, build and publish the production image on approved PRs targeting `main` |
|
||||||
|
|
||||||
## Deployment Flavours
|
## Deployment Flavours
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ There are **three ways to run the project**:
|
|||||||
| Flavour | Command | When to use |
|
| Flavour | Command | When to use |
|
||||||
|---------------------|---------------------------------|------------------------------------------------|
|
|---------------------|---------------------------------|------------------------------------------------|
|
||||||
| **Dev** | `docker compose up` | Local development — includes Mailhog |
|
| **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** | `docker run ...` | Simplest deploy — everything in one container |
|
||||||
|
|
||||||
### All-in-one Image
|
### All-in-one Image
|
||||||
@@ -104,7 +104,7 @@ The all-in-one image (`Dockerfile.allinone`) bundles **everything** into a singl
|
|||||||
- **PostgreSQL** — embedded database
|
- **PostgreSQL** — embedded database
|
||||||
- **Supervisor** — process manager that starts and supervises all three processes
|
- **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:**
|
**Minimal `docker run` command:**
|
||||||
```bash
|
```bash
|
||||||
@@ -121,7 +121,7 @@ docker run -d \
|
|||||||
-e IMAP_PORT=993 \
|
-e IMAP_PORT=993 \
|
||||||
-e APP_RECIPIENTS=friend1@example.com,friend2@example.com \
|
-e APP_RECIPIENTS=friend1@example.com,friend2@example.com \
|
||||||
-v condado-data:/var/lib/postgresql/data \
|
-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`.
|
The app is then available at `http://localhost`.
|
||||||
@@ -213,7 +213,7 @@ condado-news-letter/ ← repo root
|
|||||||
├── .env.example ← template for all env vars
|
├── .env.example ← template for all env vars
|
||||||
├── .gitignore
|
├── .gitignore
|
||||||
├── docker-compose.yml ← dev stack (Nginx + Backend + PostgreSQL + Mailhog)
|
├── 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)
|
├── Dockerfile.allinone ← all-in-one image (Nginx + Backend + PostgreSQL + Supervisor)
|
||||||
│
|
│
|
||||||
├── .github/
|
├── .github/
|
||||||
@@ -312,7 +312,7 @@ npm run test
|
|||||||
docker compose up --build
|
docker compose up --build
|
||||||
|
|
||||||
# Prod
|
# Prod
|
||||||
docker compose -f docker-compose.prod.yml up --build
|
docker compose -f docker-compose.prod.yml up -d
|
||||||
|
|
||||||
# Stop
|
# Stop
|
||||||
docker compose down
|
docker compose down
|
||||||
@@ -456,7 +456,7 @@ Never hardcode any of these values.
|
|||||||
| `OPENAI_API_KEY` | Backend | OpenAI API key |
|
| `OPENAI_API_KEY` | Backend | OpenAI API key |
|
||||||
| `OPENAI_MODEL` | Backend | OpenAI model (default: `gpt-4o`) |
|
| `OPENAI_MODEL` | Backend | OpenAI model (default: `gpt-4o`) |
|
||||||
| `APP_RECIPIENTS` | Backend | Comma-separated list of recipient emails |
|
| `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).
|
> ⚠️ Never hardcode credentials. Always use environment variables or a `.env` file (gitignored).
|
||||||
|
|
||||||
@@ -575,8 +575,9 @@ Good examples:
|
|||||||
| Workflow file | Trigger | What it does |
|
| Workflow file | Trigger | What it does |
|
||||||
|----------------------------|----------------------------|-----------------------------------------------------------|
|
|----------------------------|----------------------------|-----------------------------------------------------------|
|
||||||
| `.gitea/workflows/ci.yml` | PR to `develop` | Backend tests (`./gradlew test`) + Frontend tests (`npm run test`) |
|
| `.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.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ FROM gradle:8-jdk21-alpine AS backend-build
|
|||||||
WORKDIR /app/backend
|
WORKDIR /app/backend
|
||||||
|
|
||||||
COPY backend/build.gradle.kts backend/settings.gradle.kts ./
|
COPY backend/build.gradle.kts backend/settings.gradle.kts ./
|
||||||
|
COPY backend/gradle.properties ./
|
||||||
COPY backend/gradle ./gradle
|
COPY backend/gradle ./gradle
|
||||||
RUN gradle dependencies --no-daemon --quiet || true
|
RUN gradle dependencies --no-daemon --quiet || true
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
|
condado-newsletter:
|
||||||
# ── PostgreSQL ───────────────────────────────────────────────────────────────
|
image: gitea.lab/sancho41/condado-newsletter:latest
|
||||||
postgres:
|
container_name: condado-newsletter
|
||||||
image: postgres:16-alpine
|
restart: unless-stopped
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
POSTGRES_DB: condado
|
|
||||||
POSTGRES_USER: ${SPRING_DATASOURCE_USERNAME}
|
|
||||||
POSTGRES_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
|
|
||||||
volumes:
|
|
||||||
- postgres-data:/var/lib/postgresql/data
|
|
||||||
networks:
|
|
||||||
- condado-net
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${SPRING_DATASOURCE_USERNAME} -d condado"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
# ── Backend (Spring Boot) ────────────────────────────────────────────────────
|
|
||||||
backend:
|
|
||||||
build:
|
|
||||||
context: ./backend
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
restart: always
|
|
||||||
depends_on:
|
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
environment:
|
environment:
|
||||||
SPRING_PROFILES_ACTIVE: prod
|
SPRING_PROFILES_ACTIVE: prod
|
||||||
SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL}
|
|
||||||
SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
|
SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
|
||||||
SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
|
SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
|
||||||
APP_PASSWORD: ${APP_PASSWORD}
|
APP_PASSWORD: ${APP_PASSWORD}
|
||||||
@@ -50,27 +25,22 @@ services:
|
|||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "celtinha.desktop:host-gateway"
|
- "celtinha.desktop:host-gateway"
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
networks:
|
volumes:
|
||||||
- condado-net
|
- postgres-data:/var/lib/postgresql/data
|
||||||
|
labels:
|
||||||
# ── Frontend + Nginx ─────────────────────────────────────────────────────────
|
- "traefik.enable=true"
|
||||||
nginx:
|
- "traefik.http.routers.condado.rule=Host(`condado-newsletter.lab`)"
|
||||||
build:
|
- "traefik.http.services.condado.loadbalancer.server.port=80"
|
||||||
context: ./frontend
|
- "homepage.group=Hyperlink"
|
||||||
dockerfile: Dockerfile
|
- "homepage.name=Condado Newsletter"
|
||||||
args:
|
- "homepage.description=Automated newsletter generator using AI"
|
||||||
VITE_API_BASE_URL: ${VITE_API_BASE_URL}
|
- "homepage.logo=https://raw.githubusercontent.com/celtinha/condado-newsletter/main/docs/logo.png"
|
||||||
restart: always
|
- "homepage.url=http://condado-newsletter.lab"
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
depends_on:
|
|
||||||
- backend
|
|
||||||
networks:
|
|
||||||
- condado-net
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres-data:
|
postgres-data:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
condado-net:
|
default:
|
||||||
driver: bridge
|
name: traefik
|
||||||
|
external: true
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
APP_DB_NAME=${APP_DB_NAME:-condado}
|
||||||
|
APP_DB_USER=${SPRING_DATASOURCE_USERNAME:-condado}
|
||||||
|
APP_DB_PASSWORD=${SPRING_DATASOURCE_PASSWORD:-condado}
|
||||||
|
|
||||||
# ── Initialise PostgreSQL data directory on first run ─────────────────────────
|
# ── Initialise PostgreSQL data directory on first run ─────────────────────────
|
||||||
if [ ! -f /var/lib/postgresql/data/PG_VERSION ]; then
|
if [ ! -f /var/lib/postgresql/data/PG_VERSION ]; then
|
||||||
echo "Initialising PostgreSQL data directory..."
|
echo "Initialising PostgreSQL data directory..."
|
||||||
@@ -9,8 +13,8 @@ if [ ! -f /var/lib/postgresql/data/PG_VERSION ]; then
|
|||||||
# Start postgres temporarily to create the app database and user
|
# Start postgres temporarily to create the app database and user
|
||||||
su -c "/usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/data -w start" postgres
|
su -c "/usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/data -w start" postgres
|
||||||
|
|
||||||
su -c "psql -c \"CREATE USER condado WITH PASSWORD 'condado';\"" postgres
|
su -c "psql -v ON_ERROR_STOP=1 -c \"CREATE USER ${APP_DB_USER} WITH PASSWORD '${APP_DB_PASSWORD}';\"" postgres
|
||||||
su -c "psql -c \"CREATE DATABASE condado OWNER condado;\"" postgres
|
su -c "psql -v ON_ERROR_STOP=1 -c \"CREATE DATABASE ${APP_DB_NAME} OWNER ${APP_DB_USER};\"" postgres
|
||||||
|
|
||||||
su -c "/usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/data -w stop" postgres
|
su -c "/usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/data -w stop" postgres
|
||||||
echo "PostgreSQL initialised."
|
echo "PostgreSQL initialised."
|
||||||
@@ -20,9 +24,9 @@ fi
|
|||||||
mkdir -p /var/log/supervisor
|
mkdir -p /var/log/supervisor
|
||||||
|
|
||||||
# ── Defaults for all-in-one local PostgreSQL ─────────────────────────────────
|
# ── Defaults for all-in-one local PostgreSQL ─────────────────────────────────
|
||||||
export SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL:-jdbc:postgresql://localhost:5432/condado}
|
export SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL:-jdbc:postgresql://localhost:5432/${APP_DB_NAME}}
|
||||||
export SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME:-condado}
|
export SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME:-${APP_DB_USER}}
|
||||||
export SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD:-condado}
|
export SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD:-${APP_DB_PASSWORD}}
|
||||||
|
|
||||||
# ── Start all services via supervisord ───────────────────────────────────────
|
# ── Start all services via supervisord ───────────────────────────────────────
|
||||||
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default function DashboardPage() {
|
|||||||
|
|
||||||
<div className="grid gap-4 md:grid-cols-2">
|
<div className="grid gap-4 md:grid-cols-2">
|
||||||
<div className="rounded-xl border border-slate-800 bg-slate-900/70 p-5 shadow-sm">
|
<div className="rounded-xl border border-slate-800 bg-slate-900/70 p-5 shadow-sm">
|
||||||
<p className="text-sm text-slate-400">Active Entities</p>
|
<p className="text-sm text-slate-400">Active Entities:</p>
|
||||||
<p className="mt-1 text-2xl font-bold">{activeCount} active {activeCount === 1 ? 'entity' : 'entities'}</p>
|
<p className="mt-1 text-2xl font-bold">{activeCount} active {activeCount === 1 ? 'entity' : 'entities'}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="rounded-xl border border-slate-800 bg-slate-900/70 p-5 shadow-sm">
|
<div className="rounded-xl border border-slate-800 bg-slate-900/70 p-5 shadow-sm">
|
||||||
|
|||||||
Reference in New Issue
Block a user