Support & automatisation
Service client : Chatwoot
Section intitulée « Service client : Chatwoot »Chatwoot centralise les conversations clients (e-mail, chat sur votre
site, réseaux sociaux) dans une boîte de réception partagée. L’application tourne en deux processus —
le serveur web et un worker de tâches de fond (Sidekiq) — avec PostgreSQL (extension pgvector
incluse dans l’image) et Redis. Le dépôt de Chatwoot ne fournit qu’un compose de démonstration
(:latest, fichier .env à créer) : le compose ci-dessous en reprend les commandes, avec des images
épinglées, dans le blueprint lui-même.
apiVersion: cassiope.eu/v1alpha2kind: Blueprintproject: slug: service-client name: Service client environments: - slug: production name: Production stacks: - slug: chatwoot name: Chatwoot compose: | services: rails: image: chatwoot/chatwoot:v4.19.1 entrypoint: docker/entrypoints/rails.sh command: ["sh", "-c", "bundle exec rails db:chatwoot_prepare && bundle exec rails s -p 3000 -b 0.0.0.0"] environment: RAILS_ENV: production NODE_ENV: production INSTALLATION_ENV: docker SECRET_KEY_BASE: ${SECRET_KEY_BASE} FRONTEND_URL: ${FRONTEND_URL} ENABLE_ACCOUNT_SIGNUP: "false" POSTGRES_HOST: postgres POSTGRES_PORT: "5432" POSTGRES_DATABASE: chatwoot POSTGRES_USERNAME: chatwoot POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} REDIS_URL: redis://redis:6379 REDIS_PASSWORD: ${REDIS_PASSWORD} volumes: - storage-data:/app/storage depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: always
sidekiq: image: chatwoot/chatwoot:v4.19.1 command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"] environment: RAILS_ENV: production NODE_ENV: production INSTALLATION_ENV: docker SECRET_KEY_BASE: ${SECRET_KEY_BASE} FRONTEND_URL: ${FRONTEND_URL} POSTGRES_HOST: postgres POSTGRES_PORT: "5432" POSTGRES_DATABASE: chatwoot POSTGRES_USERNAME: chatwoot POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} REDIS_URL: redis://redis:6379 REDIS_PASSWORD: ${REDIS_PASSWORD} volumes: - storage-data:/app/storage depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: always
postgres: image: pgvector/pgvector:pg16 environment: POSTGRES_DB: chatwoot POSTGRES_USER: chatwoot POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - postgres-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U chatwoot -d chatwoot"] interval: 5s timeout: 5s retries: 10 restart: always
redis: image: redis:7-alpine command: ["sh", "-c", "redis-server --requirepass \"$$REDIS_PASSWORD\""] environment: REDIS_PASSWORD: ${REDIS_PASSWORD} volumes: - redis-data:/data healthcheck: test: ["CMD-SHELL", "redis-cli -a \"$$REDIS_PASSWORD\" ping | grep PONG"] interval: 5s timeout: 5s retries: 10 restart: always
volumes: storage-data: postgres-data: redis-data: services: - { name: rails, cpuMillicores: 1000, ramMb: 2048 } - { name: sidekiq, cpuMillicores: 500, ramMb: 1024 } - { name: postgres, cpuMillicores: 500, ramMb: 1024 } - { name: redis, cpuMillicores: 250, ramMb: 256 } volumes: - { name: storage-data, sizeGb: 5 } - { name: postgres-data, sizeGb: 10 } - { name: redis-data, sizeGb: 1 } exposed: - { serviceName: rails, port: 3000 } env: - key: FRONTEND_URL value: ${CASSIOPE_PUBLIC_URL} - key: SECRET_KEY_BASE fromSecret: true - key: POSTGRES_PASSWORD fromSecret: true - key: REDIS_PASSWORD fromSecret: trueValeurs à fournir à l’import (openssl rand -hex 64 pour SECRET_KEY_BASE, openssl rand -hex 24 pour
les deux mots de passe — sans caractère spécial) :
{ "production/chatwoot": { "SECRET_KEY_BASE": "…", "POSTGRES_PASSWORD": "…", "REDIS_PASSWORD": "…" }}Ce qu’il faut savoir :
FRONTEND_URLvaut${CASSIOPE_PUBLIC_URL}: la plateforme y met l’adresse du conteneurrails(ou votre domaine personnalisé vérifié). Chatwoot l’utilise pour les liens des e-mails et le widget de chat.- Le conteneur
railsprépare la base (db:chatwoot_prepare) avant de démarrer : le premier démarrage prend quelques minutes. Ouvrez ensuite l’adresse de la stack : l’écran d’accueil crée le compte administrateur. L’inscription libre est désactivée (ENABLE_ACCOUNT_SIGNUP). - L’envoi d’e-mails n’est pas configuré. Ajoutez les variables
SMTP_*de Chatwoot (voir sa documentation) dans les deux conteneursrailsetsidekiqpour que les réponses partent par e-mail. - Les pièces jointes sont sur le volume
storage-data, partagé parrailsetsidekiq: les deux conteneurs tournent donc sur la même machine.
Automatisation de workflows : n8n
Section intitulée « Automatisation de workflows : n8n »n8n relie vos outils par des workflows : un déclencheur (webhook, planification, e-mail), des étapes, des appels d’API. L’image officielle est épinglée, la base PostgreSQL est un add-on managé branché par binding. Les identifiants des outils connectés (CRM, messagerie, comptabilité) restent saisis dans n8n, pas dans le blueprint.
apiVersion: cassiope.eu/v1alpha2kind: Blueprintproject: slug: automatisation name: Automatisation métier environments: - slug: production name: Production addons: - slug: base-workflows name: Base des workflows templateKey: postgresql version: "16" backupEnabled: true services: - slug: n8n name: n8n type: web source: imageRef: n8nio/n8n:1.109.2 portsExposes: "5678" publiclyExposed: true healthcheckCommand: wget -q -O /dev/null http://127.0.0.1:5678/ resources: { cpuMillicores: 500, ramMb: 1024 } env: - key: N8N_ENCRYPTION_KEY fromSecret: true - key: N8N_PORT value: "5678" - key: N8N_LISTEN_ADDRESS value: 0.0.0.0 - key: GENERIC_TIMEZONE value: Europe/Paris - key: DB_TYPE value: postgresdb - key: WEBHOOK_URL value: ${CASSIOPE_PUBLIC_URL}/ bindings: - addon: base-workflows envVarKey: DB_POSTGRESDB derive: split-postgresValeur à fournir à l’import (openssl rand -hex 32) :
{ "production/n8n": { "N8N_ENCRYPTION_KEY": "…" }}Ce qu’il faut savoir :
N8N_ENCRYPTION_KEYchiffre les identifiants enregistrés dans n8n : sans elle, ils sont perdus au redéploiement suivant. Elle est fournie ici et ne doit jamais changer.split-postgres: n8n ne lit pas une URL de connexion, il attend cinq variables séparées (DB_POSTGRESDB_HOST,_PORT,_DATABASE,_USER,_PASSWORD) ; le binding les pose toutes.${CASSIOPE_PUBLIC_URL}est remplacée à chaque déploiement par l’adresse publique du service (domaine de la plateforme, ou votre domaine personnalisé une fois vérifié) : les URL de webhook affichées par n8n sont donc les bonnes sans rien saisir.- Au premier accès, n8n demande de créer le compte propriétaire.