Changeset 0.23.1 (#154)

This commit is contained in:
2026-03-06 13:26:25 +00:00
parent 2fc620e1ac
commit 4c6555cb06
38 changed files with 1536 additions and 4031 deletions

View File

@@ -1,25 +1,18 @@
version: '3.8'
# docker-compose.yml — Local development (SQLite)
#
# Single container: Go backend + nginx frontend.
# No Postgres, no sidecar, no PVC — just a mounted data directory.
#
# Usage:
# docker compose up --build
# open http://localhost:3000
#
# Data persists in ./data/ between restarts.
# To reset: rm -rf ./data/
#
# For Postgres / multi-replica / k8s deployment see k8s/ and server/Dockerfile + Dockerfile.frontend.
services:
# PostgreSQL database
postgres:
image: postgres:16-alpine
container_name: chat-switchboard-db
environment:
POSTGRES_USER: switchboard
POSTGRES_PASSWORD: ${DB_PASSWORD:-switchboard_dev}
POSTGRES_DB: chat_switchboard
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U switchboard -d chat_switchboard"]
interval: 5s
timeout: 5s
retries: 5
# Chat Switchboard (unified: Go backend + nginx frontend)
switchboard:
build:
context: .
@@ -28,36 +21,15 @@ services:
environment:
PORT: "8080"
BASE_PATH: ""
POSTGRES_HOST: postgres
POSTGRES_PORT: "5432"
POSTGRES_USER: switchboard
POSTGRES_PASSWORD: ${DB_PASSWORD:-switchboard_dev}
POSTGRES_DB: chat_switchboard
POSTGRES_SSLMODE: disable
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
DB_DRIVER: sqlite
DATABASE_URL: /data/switchboard.db
JWT_SECRET: ${JWT_SECRET:-change-me-for-production}
SWITCHBOARD_ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
SWITCHBOARD_ADMIN_PASSWORD: ${ADMIN_PASSWORD:-admin}
# File storage — mount ./data/storage on host
STORAGE_BACKEND: pvc
STORAGE_PATH: /data/storage
volumes:
- switchboard_storage:/data/storage
- ./data:/data
ports:
- "3000:80"
depends_on:
postgres:
condition: service_healthy
# Adminer for database management (optional, dev only)
adminer:
image: adminer:latest
container_name: chat-switchboard-adminer
ports:
- "8081:8080"
depends_on:
- postgres
profiles:
- dev
volumes:
postgres_data:
switchboard_storage:
restart: unless-stopped