mirror of
https://github.com/arthur-pbty/flint.git
synced 2026-08-01 20:29:03 +02:00
feat: introduce web dashboard with multi-bot management
- add Discord OAuth2 authentication - allow users to register their bots via token - implement dynamic bot start/stop system - store bots in database (multi-tenant) - replace single-bot env setup with scalable architecture
This commit is contained in:
+78
-30
@@ -4,51 +4,24 @@ x-logging: &default-logging
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
x-bot-common: &bot-common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
x-app-common: &app-common
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
stop_grace_period: 30s
|
||||
networks:
|
||||
- edge_net
|
||||
- backend_net
|
||||
logging: *default-logging
|
||||
|
||||
services:
|
||||
bot_alpha:
|
||||
<<: *bot-common
|
||||
env_file:
|
||||
- .env.bot-alpha.prod
|
||||
environment:
|
||||
STATE_BACKEND: redis
|
||||
COMMAND_DISPATCH_MODE: local
|
||||
|
||||
bot_beta:
|
||||
<<: *bot-common
|
||||
env_file:
|
||||
- .env.bot-beta.prod
|
||||
environment:
|
||||
STATE_BACKEND: redis
|
||||
COMMAND_DISPATCH_MODE: local
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
environment:
|
||||
POSTGRES_DB: discord_bots
|
||||
POSTGRES_USER: discord_bot
|
||||
POSTGRES_DB: ${POSTGRES_DB:-discord_saas}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-discord_saas}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
||||
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 --auth-local=scram-sha-256
|
||||
volumes:
|
||||
@@ -96,6 +69,81 @@ services:
|
||||
- backend_net
|
||||
logging: *default-logging
|
||||
|
||||
api:
|
||||
<<: *app-common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/api/Dockerfile
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 4000
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-discord_saas}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-discord_saas}
|
||||
DATABASE_SSL: "false"
|
||||
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
|
||||
WEB_URL: ${WEB_URL:-http://localhost:3000}
|
||||
API_BASE_URL: ${API_BASE_URL:-http://localhost:4000}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "4000:4000"
|
||||
networks:
|
||||
- edge_net
|
||||
- backend_net
|
||||
|
||||
bot:
|
||||
<<: *app-common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/bot/Dockerfile
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 4100
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-discord_saas}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-discord_saas}
|
||||
DATABASE_SSL: "false"
|
||||
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
api:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "4100:4100"
|
||||
networks:
|
||||
- edge_net
|
||||
- backend_net
|
||||
|
||||
web:
|
||||
<<: *app-common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/web/Dockerfile
|
||||
args:
|
||||
NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://localhost:4000}
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://localhost:4000}
|
||||
API_BASE_URL: ${API_BASE_URL:-http://api:4000}
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
- edge_net
|
||||
- backend_net
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
|
||||
Reference in New Issue
Block a user