E2E encrypted chat (X3DH + Double Ratchet, Signal Protocol). Server: asyncio TCP + TLS, MySQL. Clients: PyQt6 GUI + CLI. Secrets (.env, TLS keys, Cloudflare token), runtime data and mobile clients (separate repos) are gitignored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
71 lines
1.7 KiB
YAML
71 lines
1.7 KiB
YAML
version: "3.9"
|
|
|
|
# Local development stack: encrypted-chat server + MySQL
|
|
# Usage:
|
|
# docker compose up — start server + db
|
|
# docker compose up --build — rebuild server image first
|
|
# docker compose down -v — stop and remove volumes (wipes DB data)
|
|
|
|
services:
|
|
db:
|
|
image: mysql:8.0
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: devpassword
|
|
MYSQL_DATABASE: encrypted_chat
|
|
MYSQL_USER: chat
|
|
MYSQL_PASSWORD: chatpassword
|
|
volumes:
|
|
# Persist DB data between restarts
|
|
- db_data:/var/lib/mysql
|
|
# Auto-import schema on first start
|
|
- ./schema.sql:/docker-entrypoint-initdb.d/01_schema.sql:ro
|
|
ports:
|
|
- "3306:3306"
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-pdevpassword"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 30s
|
|
|
|
server:
|
|
build: .
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
ports:
|
|
- "5000:5000"
|
|
volumes:
|
|
- uploads:/app/uploads
|
|
environment:
|
|
# MySQL connection
|
|
MYSQL_HOST: db
|
|
MYSQL_PORT: 3306
|
|
MYSQL_USER: chat
|
|
MYSQL_PASSWORD: chatpassword
|
|
MYSQL_DATABASE: encrypted_chat
|
|
DB_POOL_SIZE: 10
|
|
|
|
# Server config
|
|
SERVER_HOST: 0.0.0.0
|
|
SERVER_PORT: 5000
|
|
UPLOAD_DIR: /app/uploads
|
|
|
|
# Dev mode: registration codes returned in response (no SMTP needed)
|
|
ENVIRONMENT: dev
|
|
|
|
# TLS: disabled by default for local dev (set TLS_ENABLED=true for prod)
|
|
TLS_ENABLED: "false"
|
|
|
|
# Logging
|
|
LOG_LEVEL: INFO
|
|
|
|
# Metadata retention (days)
|
|
METADATA_RETENTION_DAYS: 90
|
|
|
|
volumes:
|
|
db_data:
|
|
uploads:
|