init
This commit is contained in:
57
Dialectic/docker-compose.yaml
Normal file
57
Dialectic/docker-compose.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: ./Dialectic.Frontend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "${DIALECTIC_FRONTEND_PORT:-3000}:3000"
|
||||
environment:
|
||||
- REACT_APP_DIALECTIC_BACKEND_HOST=${DIALECTIC_BACKEND_URL:-http://localhost:8000}
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./Dialectic.Backend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "${DIALECTIC_BACKEND_PORT:-8000}:8000"
|
||||
- "127.0.0.1:${DIALECTIC_CONFIG_PORT:-9090}:9090"
|
||||
volumes:
|
||||
- dialectic_config:/app/config
|
||||
environment:
|
||||
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-BgS9_9K2UMYxiYnP-BE63UEdi7a6PHaaZ6rQZQnSx54=}
|
||||
- CONFIG_PATH=/app/config/dialectic.yaml
|
||||
- CONFIG_PORT=${DIALECTIC_CONFIG_PORT:-9090}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpassword}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-dialectic}
|
||||
MYSQL_USER: ${MYSQL_USER:-dialectic}
|
||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-dialectic}
|
||||
ports:
|
||||
- "${DB_PORT:-3306}:3306"
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
timeout: 20s
|
||||
retries: 10
|
||||
networks:
|
||||
- app-network
|
||||
volumes:
|
||||
mysql_data:
|
||||
dialectic_config:
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
47
Dialectic/init.sql
Normal file
47
Dialectic/init.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
-- MySQL initialization script for Dialectic
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS dialectic;
|
||||
USE dialectic;
|
||||
|
||||
-- Table for storing API keys for different providers
|
||||
CREATE TABLE IF NOT EXISTS api_keys (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
provider VARCHAR(50) NOT NULL UNIQUE,
|
||||
api_key_encrypted TEXT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Table for storing model configurations
|
||||
CREATE TABLE IF NOT EXISTS model_configs (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
provider VARCHAR(50) NOT NULL,
|
||||
model_name VARCHAR(100) NOT NULL,
|
||||
display_name VARCHAR(100),
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY unique_provider_model (provider, model_name)
|
||||
);
|
||||
|
||||
-- Insert default API key records (encrypted field will be empty initially)
|
||||
INSERT IGNORE INTO api_keys (provider, api_key_encrypted) VALUES
|
||||
('openai', ''),
|
||||
('claude', ''),
|
||||
('qwen', ''),
|
||||
('deepseek', '');
|
||||
|
||||
-- Insert default model configurations
|
||||
INSERT IGNORE INTO model_configs (provider, model_name, display_name) VALUES
|
||||
('openai', 'gpt-4', 'GPT-4'),
|
||||
('openai', 'gpt-3.5-turbo', 'GPT-3.5 Turbo'),
|
||||
('claude', 'claude-3-opus', 'Claude 3 Opus'),
|
||||
('claude', 'claude-3-sonnet', 'Claude 3 Sonnet'),
|
||||
('claude', 'claude-3-haiku', 'Claude 3 Haiku'),
|
||||
('qwen', 'qwen-max', 'Qwen Max'),
|
||||
('qwen', 'qwen-plus', 'Qwen Plus'),
|
||||
('deepseek', 'deepseek-chat', 'DeepSeek Chat'),
|
||||
('deepseek', 'deepseek-coder', 'DeepSeek Coder');
|
||||
|
||||
-- Add evidence_library column to debate_sessions (migration for existing databases)
|
||||
ALTER TABLE debate_sessions ADD COLUMN IF NOT EXISTS evidence_library TEXT NULL;
|
||||
Reference in New Issue
Block a user