diff --git a/.gitignore b/.gitignore
index c7dbcf2..c8df554 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
# 外部源码目录(通过 git clone 获取,不纳入本项目仓库)
-chatwoot/
-twenty/
+/chatwoot/
+/twenty/
# 敏感配置文件(含 API keys / tokens / secrets)
bridge/chatwoot.config.json
@@ -9,7 +9,7 @@ bridge/twenty.config.json
bridge/kb.config.json
chatwoot/.env
twenty/packages/twenty-docker/.env
-docker-compose.yml
+/docker-compose.yml
# 运行时生成
diff --git a/external-configs/chatwoot/app/views/widgets/show.html.erb b/external-configs/chatwoot/app/views/widgets/show.html.erb
new file mode 100644
index 0000000..6fc5391
--- /dev/null
+++ b/external-configs/chatwoot/app/views/widgets/show.html.erb
@@ -0,0 +1,43 @@
+
+
+
+ <%= @global_config['INSTALLATION_NAME'] %>
+ <%= csrf_meta_tags %>
+
+
+
+
+
+
+
+ <%= yield %>
+
+
diff --git a/external-configs/chatwoot/docker-compose.yaml b/external-configs/chatwoot/docker-compose.yaml
new file mode 100644
index 0000000..c25150e
--- /dev/null
+++ b/external-configs/chatwoot/docker-compose.yaml
@@ -0,0 +1,107 @@
+version: '3'
+
+# Chatwoot - 共享 DB 版本
+# 连接 crm-ai-demo_default 网络上的共享 crm-postgres / crm-redis,
+# 不再自带 postgres/redis/mailhog。源码构建(首次 build 需 5-10 分钟)。
+#
+# 启动: docker compose -f docker-compose.yaml --env-file .env up -d --build
+
+services:
+ base: &base
+ build:
+ context: .
+ dockerfile: ./docker/Dockerfile
+ args:
+ BUNDLE_WITHOUT: ''
+ EXECJS_RUNTIME: 'Node'
+ RAILS_ENV: 'development'
+ RAILS_SERVE_STATIC_FILES: 'false'
+ tty: true
+ stdin_open: true
+ image: chatwoot:development
+ env_file: .env
+
+ rails:
+ <<: *base
+ build:
+ context: .
+ dockerfile: ./docker/dockerfiles/rails.Dockerfile
+ image: chatwoot-rails:development
+ container_name: crm-chatwoot-rails
+ volumes:
+ - ./:/app:delegated
+ - node_modules:/app/node_modules
+ - packs:/app/public/packs
+ - cache:/app/tmp/cache
+ - bundle:/usr/local/bundle
+ ports:
+ - "3001:3000"
+ env_file: .env
+ environment:
+ - VITE_DEV_SERVER_HOST=vite
+ - NODE_ENV=development
+ - RAILS_ENV=development
+ - SAFE_FETCH_ALLOW_PRIVATE_NETWORK=true
+ entrypoint: docker/entrypoints/rails.sh
+ command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"]
+ networks:
+ - default
+ - crm-ai-demo_default
+ restart: always
+
+ sidekiq:
+ <<: *base
+ image: chatwoot-rails:development
+ container_name: crm-chatwoot-sidekiq
+ volumes:
+ - ./:/app:delegated
+ - node_modules:/app/node_modules
+ - packs:/app/public/packs
+ - cache:/app/tmp/cache
+ - bundle:/usr/local/bundle
+ environment:
+ - NODE_ENV=development
+ - RAILS_ENV=development
+ - SAFE_FETCH_ALLOW_PRIVATE_NETWORK=true
+ command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"]
+ networks:
+ - default
+ - crm-ai-demo_default
+ restart: always
+
+ vite:
+ <<: *base
+ build:
+ context: .
+ dockerfile: ./docker/dockerfiles/vite.Dockerfile
+ image: chatwoot-vite:development
+ container_name: crm-chatwoot-vite
+ volumes:
+ - ./:/app:delegated
+ - node_modules:/app/node_modules
+ - packs:/app/public/packs
+ - cache:/app/tmp/cache
+ - bundle:/usr/local/bundle
+ ports:
+ - "3036:3036"
+ environment:
+ - VITE_DEV_SERVER_HOST=0.0.0.0
+ - NODE_ENV=development
+ - RAILS_ENV=development
+ - SAFE_FETCH_ALLOW_PRIVATE_NETWORK=true
+ entrypoint: docker/entrypoints/vite.sh
+ command: bin/vite dev
+ networks:
+ - default
+ - crm-ai-demo_default
+ restart: always
+
+networks:
+ crm-ai-demo_default:
+ external: true
+
+volumes:
+ packs:
+ node_modules:
+ cache:
+ bundle:
diff --git a/external-configs/twenty/packages/twenty-docker/docker-compose.yml b/external-configs/twenty/packages/twenty-docker/docker-compose.yml
new file mode 100644
index 0000000..e713b80
--- /dev/null
+++ b/external-configs/twenty/packages/twenty-docker/docker-compose.yml
@@ -0,0 +1,69 @@
+name: twenty
+
+# Twenty CRM - 共享 DB 版本
+# 连接 crm-ai-demo_default 网络上的共享 crm-postgres / crm-redis,
+# 不再自带 postgres/redis。使用预构建镜像 twentycrm/twenty:latest。
+#
+# 启动: docker compose -f packages/twenty-docker/docker-compose.yml --env-file packages/twenty-docker/.env up -d
+
+services:
+ server:
+ image: twentycrm/twenty:${TAG:-latest}
+ container_name: crm-twenty-server
+ volumes:
+ - twenty-server-data:/app/packages/twenty-server/.local-storage
+ ports:
+ - "3000:3000"
+ environment:
+ NODE_PORT: 3000
+ PG_DATABASE_URL: postgres://${PG_DATABASE_USER:-postgres}:${PG_DATABASE_PASSWORD:-postgres}@${PG_DATABASE_HOST:-crm-postgres}:${PG_DATABASE_PORT:-5432}/${PG_DATABASE_NAME:-twenty}
+ SERVER_URL: ${SERVER_URL}
+ REDIS_URL: ${REDIS_URL}
+ DISABLE_DB_MIGRATIONS: ${DISABLE_DB_MIGRATIONS}
+ DISABLE_CRON_JOBS_REGISTRATION: ${DISABLE_CRON_JOBS_REGISTRATION}
+ STORAGE_TYPE: ${STORAGE_TYPE}
+ ENCRYPTION_KEY: ${ENCRYPTION_KEY}
+ FALLBACK_ENCRYPTION_KEY: ${FALLBACK_ENCRYPTION_KEY}
+ APP_SECRET: ${APP_SECRET}
+ SIGN_IN_PREFILLED: "true"
+ IS_BILLING_ENABLED: "false"
+ networks:
+ - default
+ - crm-ai-demo_default
+ healthcheck:
+ test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/healthz"]
+ interval: 10s
+ timeout: 5s
+ retries: 30
+ restart: always
+
+ worker:
+ image: twentycrm/twenty:${TAG:-latest}
+ container_name: crm-twenty-worker
+ volumes:
+ - twenty-server-data:/app/packages/twenty-server/.local-storage
+ command: ["yarn", "worker:prod"]
+ environment:
+ PG_DATABASE_URL: postgres://${PG_DATABASE_USER:-postgres}:${PG_DATABASE_PASSWORD:-postgres}@${PG_DATABASE_HOST:-crm-postgres}:${PG_DATABASE_PORT:-5432}/${PG_DATABASE_NAME:-twenty}
+ SERVER_URL: ${SERVER_URL}
+ REDIS_URL: ${REDIS_URL}
+ DISABLE_DB_MIGRATIONS: "true"
+ DISABLE_CRON_JOBS_REGISTRATION: "true"
+ STORAGE_TYPE: ${STORAGE_TYPE}
+ ENCRYPTION_KEY: ${ENCRYPTION_KEY}
+ FALLBACK_ENCRYPTION_KEY: ${FALLBACK_ENCRYPTION_KEY}
+ APP_SECRET: ${APP_SECRET}
+ depends_on:
+ server:
+ condition: service_healthy
+ networks:
+ - default
+ - crm-ai-demo_default
+ restart: always
+
+networks:
+ crm-ai-demo_default:
+ external: true
+
+volumes:
+ twenty-server-data: