Core infrastructure — PostgreSQL, Valkey shared services
Find a file
g1admin c1cdac8ed9
Some checks failed
Secret Scan / scan (push) Failing after 4s
docs: update README for Scheme B rename (g1-core → svc-infra)
2026-03-22 06:31:39 +00:00
.forgejo/workflows ci: add Coolify sync workflow for garage-s3 2026-03-20 22:15:32 +00:00
.gitea/issue_template chore: add infrastructure change issue template 2026-03-04 13:47:54 +00:00
.env.example Add .env.example 2026-03-04 01:17:43 +00:00
CLAUDE.md Fix CLAUDE.md encoding (was double base64-encoded) 2026-03-06 08:32:01 +00:00
docker-compose.yml Add docker-compose.yml 2026-03-04 01:17:42 +00:00
README.md docs: update README for Scheme B rename (g1-core → svc-infra) 2026-03-22 06:31:39 +00:00

svc-infra 🗄️

The bedrock of Generate One — shared PostgreSQL and Valkey powering every stack on the platform. If this goes down, everything goes down.

Status PostgreSQL Valkey License Platform Databases


Overview

svc-infra provides the foundational data layer that every other Generate One stack depends on. It runs a single hardened PostgreSQL 16 instance hosting 8+ named databases and a Valkey 9.0.1 (Redis-compatible) instance providing per-service cache, session, and queue isolation via numeric DB indexes. Both services persist to named Docker volumes with health checks wired for dependency ordering across the platform.

This is the most critical service in the entire platform. Deploy changes here with maximum care — no other stack can absorb a svc-infra outage.


🏗️ Architecture

graph TB
    subgraph svc-infra ["svc-infra (svc-infra)"]
        PG["PostgreSQL 16\npostgres-u8kg4sscgcccok088048so4\n:5432"]
        VK["Valkey 9.0.1\nvalkey-u8kg4sscgcccok088048so4\n:6379 · AOF persistence"]
    end

    subgraph pg-tenants ["PostgreSQL Databases"]
        D1[litellm]
        D2[fusio]
        D3[directus]
        D4[authentik]
        D5[n8n]
        D6[forgejo]
        D7[langfuse]
        D8[infisical]
    end

    subgraph vk-tenants ["Valkey DB Indexes"]
        V2["DB 2 — Forgejo cache"]
        V3["DB 3 — Forgejo sessions"]
        V4["DB 4 — Forgejo queue"]
        V5["DB 5 — Directus cache"]
        V6["DB 6 — Infisical"]
        V7["DB 7 — LiteLLM"]
        V8["DB 8 — Langfuse"]
    end

    PG --> D1 & D2 & D3 & D4 & D5 & D6 & D7 & D8
    VK --> V2 & V3 & V4 & V5 & V6 & V7 & V8

📦 Services

Service Image Port Volume Description
postgres postgres:16-alpine 5432 postgres-data Shared relational database for all platform services
valkey valkey/valkey:9.0.1-alpine 6379 valkey-data In-memory cache and session store with AOF persistence

🚀 Quick Start

# Service directory
cd /data/coolify/services/u8kg4sscgcccok088048so4

# Apply changes (local deploy — do NOT use Coolify UI deploy)
docker compose up -d

# Check container health
docker compose ps

# Verify PostgreSQL is ready
docker exec postgres-u8kg4sscgcccok088048so4 pg_isready -U pgadmin -d postgres

# Connect to PostgreSQL
docker exec -it postgres-u8kg4sscgcccok088048so4 psql -U pgadmin -d postgres

# Connect to Valkey
docker exec -it valkey-u8kg4sscgcccok088048so4 valkey-cli -a $VALKEY_PASSWORD ping

Important: Always use the local deploy pattern (docker compose up -d). Never use Coolify UI deploy — it will mangle the compose file and blank the .env.


🔧 Configuration

Variable Description Default
RESOURCE_UUID Coolify resource UUID for container naming u8kg4sscgcccok088048so4
POSTGRES_PASSWORD PostgreSQL superuser password Stored in Coolify env
VALKEY_PASSWORD Valkey authentication password Stored in Coolify env

Connection Strings

# PostgreSQL (from containers on the coolify network)
postgresql://pgadmin:<PASSWORD>@postgres-u8kg4sscgcccok088048so4:5432/<dbname>

# Valkey
redis://:<PASSWORD>@valkey-u8kg4sscgcccok088048so4:6379/<db_index>

🗃️ PostgreSQL Database Registry

Database Used By Project
litellm LiteLLM proxy g1-llm
fusio Fusio API gateway g1-api
directus Directus CMS g1-brain
infisical Infisical secrets svc-state
authentik Authentik SSO svc-auth
n8n n8n automation svc-automation
forgejo Forgejo git g1-code
langfuse Langfuse observability svc-observe

🔴 Valkey DB Allocation

DB Index Used By Purpose
2 Forgejo Cache
3 Forgejo Sessions
4 Forgejo Queue
5 Directus Cache
6 Infisical Session store
7 LiteLLM Cache
8 Langfuse Queue & cache

🔗 Dependencies

Depends On

  • None — svc-infra is the root dependency for the entire platform.

Depended On By

  • Every other stack — g1-llm, g1-api, g1-brain, svc-auth, svc-automation, g1-code, svc-observe, g1-gpt (indirectly)

🗂️ Quick Reference

Item Value
Coolify Project svc-infra
Coolify Service UUID u8kg4sscgcccok088048so4
Docker Network coolify (external)
PostgreSQL User pgadmin (not postgres)
PostgreSQL Version 16-alpine
Valkey Version 9.0.1-alpine

🛡️ Part of Generate One

Generate One — AI infrastructure that answers to you.

Sovereignty First · Composable · Open by Default · Developer Empathy

Self-hosted, sovereign AI platform. generate.one