diff --git a/apps/dokploy/templates/chatwoot/docker-compose.yml b/apps/dokploy/templates/chatwoot/docker-compose.yml index cf20a46a..9d062437 100644 --- a/apps/dokploy/templates/chatwoot/docker-compose.yml +++ b/apps/dokploy/templates/chatwoot/docker-compose.yml @@ -19,7 +19,7 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] + test: ["CMD-SHELL", "pg_isready -U postgres -h localhost -d chatwoot_production"] interval: 10s timeout: 5s retries: 5 @@ -58,9 +58,9 @@ services: - RAILS_LOG_TO_STDOUT=true command: > sh -c " - until PGPASSWORD=${POSTGRES_PASSWORD} psql -h postgres -U postgres -d chatwoot_production -c '\q'; do - echo 'Waiting for postgres...' - sleep 5 + echo 'Waiting for postgres...' + while ! PGPASSWORD='${POSTGRES_PASSWORD}' psql -h postgres -U postgres -d chatwoot_production -c 'SELECT 1' > /dev/null 2>&1; do + sleep 1 done echo 'PostgreSQL is ready!' bundle exec rails db:chatwoot_prepare diff --git a/apps/dokploy/templates/chatwoot/index.ts b/apps/dokploy/templates/chatwoot/index.ts index b51fc520..234b802a 100644 --- a/apps/dokploy/templates/chatwoot/index.ts +++ b/apps/dokploy/templates/chatwoot/index.ts @@ -2,9 +2,9 @@ import { type DomainSchema, type Schema, type Template, - generatePassword, - generateRandomDomain, generateBase64, + generateRandomDomain, + generatePassword, } from "../utils"; export function generate(schema: Schema): Template { @@ -22,17 +22,10 @@ export function generate(schema: Schema): Template { ]; const envs = [ - `POSTGRES_USERNAME=postgres`, - `POSTGRES_USER=postgres`, - `POSTGRES_PASSWORD=${postgresPassword}`, - `POSTGRES_DB=chatwoot_production`, - `REDIS_PASSWORD=${redisPassword}`, `CHATWOOT_HOST=${mainDomain}`, + `POSTGRES_PASSWORD=${postgresPassword}`, + `REDIS_PASSWORD=${redisPassword}`, `SECRET_KEY_BASE=${secretKeyBase}`, - `SMTP_ADDRESS=`, - `SMTP_PORT=587`, - `SMTP_USERNAME=`, - `SMTP_PASSWORD=`, ]; return {