Files
chatwoot/docs/development/environment-setup/docker.md
Anto Dominic 1ee17cc826 [Enhancement] Docker support Debugging (byebug & pry) and receive emails 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
2019-12-22 22:53:18 +05:30

1.7 KiB

path, title
path title
/docs/installation-guide-docker Docker Setup and Debugging Guide

Docker Setup and Debugging Guide

development environment

docker-compose build

After building the image or each time after destroying the stack you would have to create and migrate the database before you can start the rails server or run rspec tests.

docker-compose run rails bundle exec rails db:create db:migrate db:seed

Running the rails app in debug mode (pry and byebug works)

docker-compose run --service-port rails
  • Access the rails app frontend by visiting http://0.0.0.0:3000/ (You can access the website over http for debugging using pry and Byebug here)

  • Access Mailhog inbox by visiting http://0.0.0.0:8025/ (You will receive all emails going out of the application here)

Running the complete stack in non-debug mode

docker-compose up
  • Access the rails app frontend by visiting http://0.0.0.0:3000/ (This is web only, you cannot debug using docker-compose up)
  • Access Mailhog inbox by visiting http://0.0.0.0:8025/ (You will receive all emails going out of the application here)

Destroying the complete composer stack

docker-compose down

Running rspec tests

For running the complete rspec tests

docker-compose run rails bundle exec rspec

For running specific test:

docker-compose run rails bundle exec rspec spec/<path-to-file>:<line-number>

production environment

docker-compose -f docker-compose.production.yaml build

If you want to test the production build locally you would first need to set SECRET_KEY_BASE environment variable in your .env.example file and then run the below command:

docker-compose -f docker-compose.production.yaml up