Add external service config overrides (Chatwoot compose + widget fix, Twenty compose)

- external-configs/chatwoot/docker-compose.yaml: shared DB version
- external-configs/chatwoot/app/views/widgets/show.html.erb: bypass broken Vite
- external-configs/twenty/packages/twenty-docker/docker-compose.yml: shared DB version
- .gitignore: fix path patterns (root-only for dirs, docker-compose.yml)
This commit is contained in:
AI Bridge Dev
2026-07-27 15:31:24 +08:00
parent f355df605e
commit a9dee69e61
4 changed files with 222 additions and 3 deletions

6
.gitignore vendored
View File

@@ -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
# 运行时生成

View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title><%= @global_config['INSTALLATION_NAME'] %></title>
<%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
<script>
window.chatwootWebChannel = {
avatarUrl: '<%= @web_widget.inbox.avatar_url %>',
hasAConnectedAgentBot: '<%= @web_widget.inbox.agent_bot&.name %>',
locale: '<%= @web_widget.account.locale %>',
websiteName: '<%= @web_widget.inbox.name %>',
websiteToken: '<%= @web_widget.website_token %>',
welcomeTagline: <%= @web_widget.welcome_tagline.to_json.html_safe %>,
welcomeTitle: '<%= @web_widget.welcome_title %>',
widgetColor: '<%= @web_widget.widget_color %>',
portal: <%= @web_widget.inbox.portal.to_json.html_safe %>,
enabledFeatures: <%= @web_widget.selected_feature_flags.to_json.html_safe %>,
enabledLanguages: <%= available_locales_with_name.to_json.html_safe %>,
replyTime: '<%= @web_widget.reply_time %>',
preChatFormEnabled: <%= @web_widget.pre_chat_form_enabled %>,
preChatFormOptions: <%= @web_widget.pre_chat_form_options.to_json.html_safe %>,
workingHoursEnabled: <%= @web_widget.inbox.working_hours_enabled %>,
csatSurveyEnabled: <%= @web_widget.inbox.csat_survey_enabled %>,
workingHours: <%= @web_widget.inbox.working_hours.to_json.html_safe %>,
outOfOfficeMessage: <%= @web_widget.inbox.out_of_office_message.to_json.html_safe %>,
utcOffset: '<%= ActiveSupport::TimeZone[@web_widget.inbox.timezone].now.formatted_offset %>',
timezone: '<%= @web_widget.inbox.timezone %>',
allowMessagesAfterResolved: <%= @web_widget.inbox.allow_messages_after_resolved %>,
disableBranding: <%= @web_widget.inbox.account.feature_enabled?('disable_branding') %>,
}
window.chatwootPubsubToken = '<%= @contact_inbox.pubsub_token %>'
window.authToken = '<%= @token %>'
window.globalConfig = <%= raw @global_config.to_json %>
</script>
<link rel="stylesheet" href="/widget-assets/js/widget-DTe0i86F.css" />
<script src="/widget-assets/js/widget-CFzXyT6u.js" type="module"></script>
</head>
<body>
<div id="app" class="h-full"></div>
<%= yield %>
</body>
</html>

View File

@@ -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:

View File

@@ -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: