Skip to content

Commit

Permalink
[Enhancement] Docker support Debugging (byebug & pry) and receive ema…
Browse files Browse the repository at this point in the history
…ils to MailHog via smtp (#371)

* updated development docker setup

* turned on yarn integrity check

* create test docker compose and update development dockerfile

* create docker Readme.md file

* fix README.md file

* create docker-copmose and dockerfile for production/staging environment setup

* added mailhog to catch email

* remove yarn integrity check in development mode!

* Update Readme.md file to support mailhog inbox

* update link to docker development guide from mail README

* remove .env.development and use .env.example for docker as .env.development was mixing with circleci config

* make the dockerfile configurable like before

* update docker-compose as per suggesion in PR

* create docker setup docs

* Revert accidental deletion

* fix: typo for branding consistency

* fix typo

* update the code as per recommendation in PR

* remove package-lock and add gitignore

* fix vulnerability AND update env for tests to pass

* Fix yarn integrity check across different docker services

* update code based on rubocop and PR suggestions

* remove redundant test docker-compose and dockerfile

* update rails entrypoint, update docs and Gemfile

* [Rubocop] order Gemfile alphabetically

* Reordering Gemfile
  • Loading branch information
antodoms authored and sojan-official committed Dec 22, 2019
1 parent 6bdac3d commit 1ee17cc
Show file tree
Hide file tree
Showing 18 changed files with 363 additions and 141 deletions.
33 changes: 20 additions & 13 deletions .env.example
@@ -1,19 +1,32 @@
REDIS_URL=redis://redis:6379
SECRET_KEY_BASE=

# Postgres Database config variables
POSTGRES_HOST=postgres
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=
RAILS_ENV=development
RAILS_MAX_THREADS=5

#fb app
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=

#mail
MAILER_SENDER_EMAIL=
SMTP_ADDRESS=
MAILER_SENDER_EMAIL=accounts@chatwoot.com
SMTP_PORT=1025
SMTP_DOMAIN=chatwoot.com
SMTP_ADDRESS=mailhog
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_AUTHENTICATION=
SMTP_ENABLE_STARTTLS_AUTO=

#misc
FRONTEND_URL=http://localhost:3000
FRONTEND_URL=http://0.0.0.0:3000

#s3

S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
Expand All @@ -23,16 +36,10 @@ AWS_REGION=
SENTRY_DSN=

#### This environment variables are only required in hosted version which has billing
BILLING_ENABLED=
ENABLE_BILLING=

## chargebee settings
CHARGEBEE_API_KEY=
CHARGEBEE_SITE=
CHARGEBEE_WEBHOOK_USERNAME=
CHARGEBEE_WEBHOOK_PASSWORD=

#Database config variables
POSTGRES_HOST=localhost
POSTGRES_DATABASE=chatwoot_dev
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=
RAILS_MAX_THREADS=5
CHARGEBEE_WEBHOOK_PASSWORD=
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -45,3 +45,7 @@ buildreports
coverage

/storage

# ignore packages
node_modules
package-lock.json
1 change: 1 addition & 0 deletions .rubocop.yml
Expand Up @@ -18,6 +18,7 @@ Metrics/BlockLength:
Exclude:
- spec/**/*
- '**/routes.rb'
- 'config/environments/*'
Rails/ApplicationController:
Exclude:
- 'app/controllers/api/v1/widget/messages_controller.rb'
Expand Down
11 changes: 4 additions & 7 deletions Gemfile
Expand Up @@ -80,26 +80,23 @@ group :development do
gem 'web-console'
end

group :test do
gem 'action-cable-testing'
gem 'mock_redis'
gem 'shoulda-matchers'
gem 'simplecov', require: false
end

group :development, :test do
gem 'action-cable-testing'
gem 'bundle-audit', require: false
gem 'byebug', platform: :mri
gem 'factory_bot_rails'
gem 'faker'
gem 'listen'
gem 'mock_redis'
gem 'pry-rails'
gem 'rspec-rails', '~> 4.0.0.beta2'
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
gem 'seed_dump'
gem 'shoulda-matchers'
gem 'simplecov', require: false
gem 'spring'
gem 'spring-watcher-listen'
end
132 changes: 66 additions & 66 deletions Gemfile.lock
Expand Up @@ -3,56 +3,56 @@ GEM
specs:
action-cable-testing (0.6.0)
actioncable (>= 5.0)
actioncable (6.0.1)
actionpack (= 6.0.1)
actioncable (6.0.2.1)
actionpack (= 6.0.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.1)
actionpack (= 6.0.1)
activejob (= 6.0.1)
activerecord (= 6.0.1)
activestorage (= 6.0.1)
activesupport (= 6.0.1)
actionmailbox (6.0.2.1)
actionpack (= 6.0.2.1)
activejob (= 6.0.2.1)
activerecord (= 6.0.2.1)
activestorage (= 6.0.2.1)
activesupport (= 6.0.2.1)
mail (>= 2.7.1)
actionmailer (6.0.1)
actionpack (= 6.0.1)
actionview (= 6.0.1)
activejob (= 6.0.1)
actionmailer (6.0.2.1)
actionpack (= 6.0.2.1)
actionview (= 6.0.2.1)
activejob (= 6.0.2.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.1)
actionview (= 6.0.1)
activesupport (= 6.0.1)
rack (~> 2.0)
actionpack (6.0.2.1)
actionview (= 6.0.2.1)
activesupport (= 6.0.2.1)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.1)
actionpack (= 6.0.1)
activerecord (= 6.0.1)
activestorage (= 6.0.1)
activesupport (= 6.0.1)
actiontext (6.0.2.1)
actionpack (= 6.0.2.1)
activerecord (= 6.0.2.1)
activestorage (= 6.0.2.1)
activesupport (= 6.0.2.1)
nokogiri (>= 1.8.5)
actionview (6.0.1)
activesupport (= 6.0.1)
actionview (6.0.2.1)
activesupport (= 6.0.2.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.1)
activesupport (= 6.0.1)
activejob (6.0.2.1)
activesupport (= 6.0.2.1)
globalid (>= 0.3.6)
activemodel (6.0.1)
activesupport (= 6.0.1)
activerecord (6.0.1)
activemodel (= 6.0.1)
activesupport (= 6.0.1)
activestorage (6.0.1)
actionpack (= 6.0.1)
activejob (= 6.0.1)
activerecord (= 6.0.1)
activemodel (6.0.2.1)
activesupport (= 6.0.2.1)
activerecord (6.0.2.1)
activemodel (= 6.0.2.1)
activesupport (= 6.0.2.1)
activestorage (6.0.2.1)
actionpack (= 6.0.2.1)
activejob (= 6.0.2.1)
activerecord (= 6.0.2.1)
marcel (~> 0.3.1)
activesupport (6.0.1)
activesupport (6.0.2.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -68,16 +68,16 @@ GEM
ast (2.4.0)
attr_extras (6.2.1)
aws-eventstream (1.0.3)
aws-partitions (1.251.0)
aws-sdk-core (3.84.0)
aws-partitions (1.259.0)
aws-sdk-core (3.86.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.26.0)
aws-sdk-kms (1.27.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.59.0)
aws-sdk-s3 (1.60.1)
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
Expand All @@ -94,7 +94,7 @@ GEM
brakeman (4.7.2)
browser (2.7.1)
buftok (0.2.0)
builder (3.2.3)
builder (3.2.4)
bullet (6.0.2)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
Expand Down Expand Up @@ -154,7 +154,7 @@ GEM
factory_bot_rails (5.1.1)
factory_bot (~> 5.1.0)
railties (>= 4.2.0)
faker (2.8.1)
faker (2.9.0)
i18n (>= 1.6, < 1.8)
faraday (0.17.1)
multipart-post (>= 1.2, < 3)
Expand All @@ -174,21 +174,21 @@ GEM
domain_name (~> 0.5)
http-form_data (2.1.1)
http_parser.rb (0.6.0)
httparty (0.17.1)
httparty (0.17.3)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.7.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
image_processing (1.9.3)
image_processing (1.10.0)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.13, < 3)
inflecto (0.0.2)
jaro_winkler (1.5.4)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
jmespath (1.4.0)
json (2.2.0)
json (2.3.0)
json_pure (2.2.0)
jwt (2.2.1)
kaminari (1.1.1)
Expand Down Expand Up @@ -268,29 +268,29 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.1)
actioncable (= 6.0.1)
actionmailbox (= 6.0.1)
actionmailer (= 6.0.1)
actionpack (= 6.0.1)
actiontext (= 6.0.1)
actionview (= 6.0.1)
activejob (= 6.0.1)
activemodel (= 6.0.1)
activerecord (= 6.0.1)
activestorage (= 6.0.1)
activesupport (= 6.0.1)
rails (6.0.2.1)
actioncable (= 6.0.2.1)
actionmailbox (= 6.0.2.1)
actionmailer (= 6.0.2.1)
actionpack (= 6.0.2.1)
actiontext (= 6.0.2.1)
actionview (= 6.0.2.1)
activejob (= 6.0.2.1)
activemodel (= 6.0.2.1)
activerecord (= 6.0.2.1)
activestorage (= 6.0.2.1)
activesupport (= 6.0.2.1)
bundler (>= 1.3.0)
railties (= 6.0.1)
railties (= 6.0.2.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.1)
actionpack (= 6.0.1)
activesupport (= 6.0.1)
railties (6.0.2.1)
actionpack (= 6.0.2.1)
activesupport (= 6.0.2.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
Expand All @@ -300,7 +300,7 @@ GEM
rb-inotify (0.10.0)
ffi (~> 1.0)
redis (4.1.3)
redis-namespace (1.6.0)
redis-namespace (1.7.0)
redis (>= 3.0.4)
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
Expand Down Expand Up @@ -332,7 +332,7 @@ GEM
rspec-mocks (~> 3.8)
rspec-support (~> 3.8)
rspec-support (3.9.0)
rubocop (0.77.0)
rubocop (0.78.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
Expand All @@ -344,19 +344,19 @@ GEM
rubocop-rails (2.4.0)
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.0)
rubocop-rspec (1.37.1)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
ruby-vips (2.0.16)
ffi (~> 1.9)
seed_dump (3.3.1)
activerecord (>= 4)
activesupport (>= 4)
sentry-raven (2.12.3)
sentry-raven (2.13.0)
faraday (>= 0.7.6, < 1.0)
shoulda-matchers (4.1.2)
activesupport (>= 4.2.0)
sidekiq (6.0.3)
sidekiq (6.0.4)
connection_pool (>= 2.2.2)
rack (>= 2.0.0)
rack-protection (>= 2.0.0)
Expand Down Expand Up @@ -424,7 +424,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webpacker (4.2.0)
webpacker (4.2.2)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -53,7 +53,9 @@ You can use our official Docker image from [https://hub.docker.com/r/chatwoot/ch
docker pull chatwoot/chatwoot
```

Follow our [environment variables](https://www.chatwoot.com/docs/environment-variables/) guide to setup environment for Docker
Follow our [environment variables](https://www.chatwoot.com/docs/environment-variables/) guide to setup environment for Docker.

Follow our [docker development guide](docker/README.md) to develop and debug the application using docker composer.

## Contributors ✨

Expand Down

0 comments on commit 1ee17cc

Please sign in to comment.