|
87 | 87 | 'pull_request_html_url' => 'https://github.com/coollabsio/coolify-examples/pull/1',
|
88 | 88 | ]);
|
89 | 89 | $this->serviceYaml = '
|
90 |
| -version: "3.8" |
91 | 90 | services:
|
92 |
| - app: |
93 |
| - image: nginx |
| 91 | + chatwoot: |
| 92 | + image: chatwoot/chatwoot:latest |
| 93 | + depends_on: |
| 94 | + - postgres |
| 95 | + - redis |
94 | 96 | environment:
|
95 |
| - SERVICE_FQDN_APP: /app |
96 |
| - APP_KEY: base64 |
97 |
| - APP_DEBUG: "${APP_DEBUG:-false}" |
98 |
| - APP_URL: $SERVICE_FQDN_APP |
99 |
| - DB_URL: postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@db:5432/postgres?schema=public |
| 97 | + - SERVICE_FQDN_CHATWOOT_3000 |
| 98 | + - SECRET_KEY_BASE=$SERVICE_PASSWORD_CHATWOOT |
| 99 | + - FRONTEND_URL=${SERVICE_FQDN_CHATWOOT} |
| 100 | + - DEFAULT_LOCALE=${CHATWOOT_DEFAULT_LOCALE} |
| 101 | + - FORCE_SSL=false |
| 102 | + - ENABLE_ACCOUNT_SIGNUP=false |
| 103 | + - REDIS_URL=redis://default@redis:6379 |
| 104 | + - REDIS_PASSWORD=$SERVICE_PASSWORD_REDIS |
| 105 | + - REDIS_OPENSSL_VERIFY_MODE=none |
| 106 | + - POSTGRES_DATABASE=chatwoot |
| 107 | + - POSTGRES_HOST=postgres |
| 108 | + - POSTGRES_USERNAME=$SERVICE_USER_POSTGRES_USER |
| 109 | + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES |
| 110 | + - RAILS_MAX_THREADS=5 |
| 111 | + - NODE_ENV=production |
| 112 | + - RAILS_ENV=production |
| 113 | + - INSTALLATION_ENV=docker |
| 114 | + - MAILER_SENDER_EMAIL=${CHATWOOT_MAILER_SENDER_EMAIL} |
| 115 | + - SMTP_ADDRESS=${CHATWOOT_SMTP_ADDRESS} |
| 116 | + - SMTP_AUTHENTICATION=${CHATWOOT_SMTP_AUTHENTICATION} |
| 117 | + - SMTP_DOMAIN=${CHATWOOT_SMTP_DOMAIN} |
| 118 | + - SMTP_ENABLE_STARTTLS_AUTO=${CHATWOOT_SMTP_ENABLE_STARTTLS_AUTO} |
| 119 | + - SMTP_PORT=${CHATWOOT_SMTP_PORT} |
| 120 | + - SMTP_USERNAME=${CHATWOOT_SMTP_USERNAME} |
| 121 | + - SMTP_PASSWORD=${CHATWOOT_SMTP_PASSWORD} |
| 122 | + - ACTIVE_STORAGE_SERVICE=local |
| 123 | + entrypoint: docker/entrypoints/rails.sh |
| 124 | + command: sh -c "bundle exec rails db:chatwoot_prepare && bundle exec rails s -p 3000 -b 0.0.0.0" |
100 | 125 | volumes:
|
101 |
| - - "./nginx:/etc/nginx" |
102 |
| - - "data:/var/www/html" |
| 126 | + - rails-data:/app/storage |
| 127 | + healthcheck: |
| 128 | + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:3000"] |
| 129 | + interval: 5s |
| 130 | + timeout: 20s |
| 131 | + retries: 10 |
| 132 | +
|
| 133 | + sidekiq: |
| 134 | + image: chatwoot/chatwoot:latest |
103 | 135 | depends_on:
|
104 |
| - - db |
105 |
| - db: |
106 |
| - image: postgres |
| 136 | + - postgres |
| 137 | + - redis |
107 | 138 | environment:
|
108 |
| - POSTGRES_USER: "${SERVICE_USER_POSTGRES}" |
109 |
| - POSTGRES_PASSWORD: "${SERVICE_PASSWORD_POSTGRES}" |
| 139 | + - SECRET_KEY_BASE=$SERVICE_PASSWORD_CHATWOOT |
| 140 | + - FRONTEND_URL=${SERVICE_FQDN_CHATWOOT} |
| 141 | + - DEFAULT_LOCALE=${CHATWOOT_DEFAULT_LOCALE} |
| 142 | + - FORCE_SSL=false |
| 143 | + - ENABLE_ACCOUNT_SIGNUP=false |
| 144 | + - REDIS_URL=redis://default@redis:6379 |
| 145 | + - REDIS_PASSWORD=$SERVICE_PASSWORD_REDIS |
| 146 | + - REDIS_OPENSSL_VERIFY_MODE=none |
| 147 | + - POSTGRES_DATABASE=chatwoot |
| 148 | + - POSTGRES_HOST=postgres |
| 149 | + - POSTGRES_USERNAME=$SERVICE_USER_POSTGRES_USER |
| 150 | + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES |
| 151 | + - RAILS_MAX_THREADS=5 |
| 152 | + - NODE_ENV=production |
| 153 | + - RAILS_ENV=production |
| 154 | + - INSTALLATION_ENV=docker |
| 155 | + - MAILER_SENDER_EMAIL=${CHATWOOT_MAILER_SENDER_EMAIL} |
| 156 | + - SMTP_ADDRESS=${CHATWOOT_SMTP_ADDRESS} |
| 157 | + - SMTP_AUTHENTICATION=${CHATWOOT_SMTP_AUTHENTICATION} |
| 158 | + - SMTP_DOMAIN=${CHATWOOT_SMTP_DOMAIN} |
| 159 | + - SMTP_ENABLE_STARTTLS_AUTO=${CHATWOOT_SMTP_ENABLE_STARTTLS_AUTO} |
| 160 | + - SMTP_PORT=${CHATWOOT_SMTP_PORT} |
| 161 | + - SMTP_USERNAME=${CHATWOOT_SMTP_USERNAME} |
| 162 | + - SMTP_PASSWORD=${CHATWOOT_SMTP_PASSWORD} |
| 163 | + - ACTIVE_STORAGE_SERVICE=local |
| 164 | + command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"] |
110 | 165 | volumes:
|
111 |
| - - "dbdata:/var/lib/postgresql/data" |
| 166 | + - sidekiq-data:/app/storage |
112 | 167 | healthcheck:
|
113 |
| - test: |
114 |
| - - CMD |
115 |
| - - pg_isready |
116 |
| - - "-U" |
117 |
| - - "postgres" |
118 |
| - interval: 2s |
| 168 | + test: ["CMD-SHELL", "bundle exec rails runner \'puts Sidekiq.redis(&:info)\' > /dev/null 2>&1"] |
| 169 | + interval: 30s |
119 | 170 | timeout: 10s
|
120 |
| - retries: 10 |
121 |
| - depends_on: |
122 |
| - app: |
123 |
| - condition: service_healthy |
| 171 | + retries: 3 |
| 172 | +
|
| 173 | + postgres: |
| 174 | + image: postgres:12 |
| 175 | + restart: always |
| 176 | + volumes: |
| 177 | + - postgres-data:/var/lib/postgresql/data |
| 178 | + environment: |
| 179 | + - POSTGRES_DB=chatwoot |
| 180 | + - POSTGRES_USER=$SERVICE_USER_POSTGRES_USER |
| 181 | + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES |
| 182 | + healthcheck: |
| 183 | + test: ["CMD-SHELL", "pg_isready -U $SERVICE_USER_POSTGRES_USER -d chatwoot -h 127.0.0.1"] |
| 184 | + interval: 30s |
| 185 | + timeout: 10s |
| 186 | + retries: 5 |
| 187 | +
|
| 188 | + redis: |
| 189 | + image: redis:alpine |
| 190 | + restart: always |
| 191 | + command: ["sh", "-c", "redis-server --requirepass \"$SERVICE_PASSWORD_REDIS\""] |
| 192 | + volumes: |
| 193 | + - redis-data:/data |
| 194 | + healthcheck: |
| 195 | + test: ["CMD", "redis-cli", "-a", "$SERVICE_PASSWORD_REDIS", "PING"] |
| 196 | + interval: 30s |
| 197 | + timeout: 10s |
| 198 | + retries: 5 |
| 199 | +
|
124 | 200 | ';
|
125 | 201 |
|
126 | 202 | $this->serviceComposeFileString = Yaml::parse($this->serviceYaml);
|
|
0 commit comments