-
create
.env
file based on.env.template
cp .env.template .env
-
build
docker-compose build
- setup database
docker-compose run --rm web rails db:setup
- run
docker-compose up
docker-compose run --rm web rspec
to run rspec tests
docker-compose run --rm web rubocop
to run rubocop
docker-compose run --rm web rubocop -a
to run rubocop in the auto-correct mode
You need to run rails server with ports expose to the host. It can by achieved by --service-ports flag.
docker-compose run --service-ports web
Now you can put binding.pry
anywhere in the code. The code execution will stop in this point and you can then start “asking” questions like params
or try to reach some variables etc.
RUBYOPT='-W:no-deprecated -W:no-experimental' + rails commands