Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Guide] Setup on Coolify #17

Open
Simon-Laux opened this issue Nov 22, 2024 · 0 comments
Open

[Guide] Setup on Coolify #17

Simon-Laux opened this issue Nov 22, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@Simon-Laux
Copy link

The are the steps / modifications I made to got it running on https://coolify.io.

  1. I installed the stock chatwoot service
  2. I started it and setup an account on chatwoot and got the api/access token
  3. then I added the following env vars:
WOOT_PROFILE_ACCESS_TOKEN=<access token>
DELTAWOOT_ADDR=<(chat)mail-address>
DELTAWOOT_PASSWORD=<(chat)mail-password>
WOOT_ACCOUNT_ID=1
  1. Then I modified the docker compose for the chatwoot service in the coolify interface, to add deltawoot:
  deltawoot:
    links: # fix for hard dependency on chatwoot container name being "rails"
      - "chatwoot:rails"
    image: missytake/deltawoot:latest
    restart: always
    environment:
      - WOOT_PROFILE_ACCESS_TOKEN=$WOOT_PROFILE_ACCESS_TOKEN
      - DELTAWOOT_ADDR=$DELTAWOOT_ADDR
      - DELTAWOOT_PASSWORD=$DELTAWOOT_PASSWORD
      - WOOT_ACCOUNT_ID=$WOOT_ACCOUNT_ID
    depends_on:
      - chatwoot
    volumes:
      - deltawoot:/home/deltawoot/files
    ports:
      - "127.0.0.1:5000:5000"

volumes:
  deltawoot:
Full changed file
services:
  chatwoot:
    image: 'chatwoot/chatwoot:latest'
    depends_on:
      - postgres
      - redis
    environment:
      - SERVICE_FQDN_CHATWOOT_3000
      - SECRET_KEY_BASE=$SERVICE_PASSWORD_CHATWOOT
      - 'FRONTEND_URL=${SERVICE_FQDN_CHATWOOT}'
      - 'DEFAULT_LOCALE=${CHATWOOT_DEFAULT_LOCALE}'
      - 'FORCE_SSL=${FORCE_SSL:-false}'
      - 'ENABLE_ACCOUNT_SIGNUP=${ENABLE_ACCOUNT_SIGNUP:-false}'
      - 'REDIS_URL=redis://default@redis:6379'
      - REDIS_PASSWORD=$SERVICE_PASSWORD_REDIS
      - 'REDIS_OPENSSL_VERIFY_MODE=${REDIS_OPENSSL_VERIFY_MODE:-none}'
      - 'POSTGRES_DATABASE=${POSTGRES_DB:-chatwoot}'
      - 'POSTGRES_HOST=${POSTGRES_HOST:-postgres}'
      - POSTGRES_USERNAME=$SERVICE_USER_POSTGRES
      - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
      - 'RAILS_MAX_THREADS=${RAILS_MAX_THREADS:-5}'
      - 'NODE_ENV=${NODE_ENV:-production}'
      - 'RAILS_ENV=${RAILS_ENV:-production}'
      - 'INSTALLATION_ENV=${INSTALLATION_ENV:-docker}'
      - 'MAILER_SENDER_EMAIL=${CHATWOOT_MAILER_SENDER_EMAIL}'
      - 'SMTP_ADDRESS=${CHATWOOT_SMTP_ADDRESS}'
      - 'SMTP_AUTHENTICATION=${CHATWOOT_SMTP_AUTHENTICATION}'
      - 'SMTP_DOMAIN=${CHATWOOT_SMTP_DOMAIN}'
      - 'SMTP_ENABLE_STARTTLS_AUTO=${CHATWOOT_SMTP_ENABLE_STARTTLS_AUTO}'
      - 'SMTP_PORT=${CHATWOOT_SMTP_PORT}'
      - 'SMTP_USERNAME=${CHATWOOT_SMTP_USERNAME}'
      - 'SMTP_PASSWORD=${CHATWOOT_SMTP_PASSWORD}'
      - 'ACTIVE_STORAGE_SERVICE=${ACTIVE_STORAGE_SERVICE:-local}'
    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"'
    volumes:
      - 'rails-data:/app/storage'
    healthcheck:
      test:
        - CMD
        - wget
        - '--spider'
        - '-q'
        - 'http://127.0.0.1:3000'
      interval: 5s
      timeout: 20s
      retries: 10
  sidekiq:
    image: 'chatwoot/chatwoot:latest'
    depends_on:
      - postgres
      - redis
    environment:
      - SECRET_KEY_BASE=$SERVICE_PASSWORD_CHATWOOT
      - 'FRONTEND_URL=${SERVICE_FQDN_CHATWOOT}'
      - 'DEFAULT_LOCALE=${CHATWOOT_DEFAULT_LOCALE}'
      - 'FORCE_SSL=${FORCE_SSL:-false}'
      - 'ENABLE_ACCOUNT_SIGNUP=${ENABLE_ACCOUNT_SIGNUP:-false}'
      - 'REDIS_URL=redis://default@redis:6379'
      - REDIS_PASSWORD=$SERVICE_PASSWORD_REDIS
      - 'REDIS_OPENSSL_VERIFY_MODE=${REDIS_OPENSSL_VERIFY_MODE:-none}'
      - 'POSTGRES_DATABASE=${POSTGRES_DB:-chatwoot}'
      - 'POSTGRES_HOST=${POSTGRES_HOST:-postgres}'
      - POSTGRES_USERNAME=$SERVICE_USER_POSTGRES
      - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
      - 'RAILS_MAX_THREADS=${RAILS_MAX_THREADS:-5}'
      - 'NODE_ENV=${NODE_ENV:-production}'
      - 'RAILS_ENV=${RAILS_ENV:-production}'
      - 'INSTALLATION_ENV=${INSTALLATION_ENV:-docker}'
      - 'MAILER_SENDER_EMAIL=${CHATWOOT_MAILER_SENDER_EMAIL}'
      - 'SMTP_ADDRESS=${CHATWOOT_SMTP_ADDRESS}'
      - 'SMTP_AUTHENTICATION=${CHATWOOT_SMTP_AUTHENTICATION}'
      - 'SMTP_DOMAIN=${CHATWOOT_SMTP_DOMAIN}'
      - 'SMTP_ENABLE_STARTTLS_AUTO=${CHATWOOT_SMTP_ENABLE_STARTTLS_AUTO}'
      - 'SMTP_PORT=${CHATWOOT_SMTP_PORT}'
      - 'SMTP_USERNAME=${CHATWOOT_SMTP_USERNAME}'
      - 'SMTP_PASSWORD=${CHATWOOT_SMTP_PASSWORD}'
      - 'ACTIVE_STORAGE_SERVICE=${ACTIVE_STORAGE_SERVICE:-local}'
    command:
      - bundle
      - exec
      - sidekiq
      - '-C'
      - config/sidekiq.yml
    volumes:
      - 'sidekiq-data:/app/storage'
    healthcheck:
      test:
        - CMD-SHELL
        - "bundle exec rails runner 'puts Sidekiq.redis(&:info)' > /dev/null 2>&1"
      interval: 30s
      timeout: 10s
      retries: 3
  postgres:
    image: 'postgres:12'
    restart: always
    volumes:
      - 'postgres-data:/var/lib/postgresql/data'
    environment:
      - 'POSTGRES_DB=${POSTGRES_DB:-chatwoot}'
      - POSTGRES_USER=$SERVICE_USER_POSTGRES
      - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
    healthcheck:
      test:
        - CMD-SHELL
        - 'pg_isready -U $SERVICE_USER_POSTGRES -d chatwoot -h 127.0.0.1'
      interval: 30s
      timeout: 10s
      retries: 5
  redis:
    image: 'redis:alpine'
    restart: always
    command:
      - sh
      - '-c'
      - 'redis-server --requirepass "$SERVICE_PASSWORD_REDIS"'
    volumes:
      - 'redis-data:/data'
    healthcheck:
      test:
        - CMD
        - redis-cli
        - '-a'
        - $SERVICE_PASSWORD_REDIS
        - PING
      interval: 30s
      timeout: 10s
      retries: 5
  deltawoot:
    links: # fix for hard dependency on chatwoot container name being "rails"
      - "chatwoot:rails"
    image: missytake/deltawoot:latest
    restart: always
    environment:
      - WOOT_PROFILE_ACCESS_TOKEN=$WOOT_PROFILE_ACCESS_TOKEN
      - DELTAWOOT_ADDR=$DELTAWOOT_ADDR
      - DELTAWOOT_PASSWORD=$DELTAWOOT_PASSWORD
      - WOOT_ACCOUNT_ID=$WOOT_ACCOUNT_ID
    depends_on:
      - chatwoot
    volumes:
      - deltawoot:/home/deltawoot/files
    ports:
      - "127.0.0.1:5000:5000"

volumes:
  deltawoot:
  1. I restarted the service in coolify and set the web hook url in coolify on the deltachat inbox to http://deltawoot:5000

This could be either added to the readme or a separate "setup on coolify" guide.

Furthermore the links attribute hint might be something useful for the readme, for the case that the chatwoot container is not called "rails":

  deltawoot:
    links: # fix for hard dependency on chatwoot container name being "rails"
      - "chatwoot:rails"
@Simon-Laux Simon-Laux changed the title Setup on Coolify [Guide] Setup on Coolify Nov 22, 2024
@Simon-Laux Simon-Laux added the documentation Improvements or additions to documentation label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant