-
Create file
.envandenv.testoff file.env.sample. -
Add values in the variables empties
-
Add value below on file
.env
DATABASE_URL=postgres://postgres:postgres@db:5432/projeto_development- Add value below on file
.env.test
DATABASE_URL=postgres://postgres:postgres@db:5432/projeto_test- Create file
.env.sidekiqand add values below:
REDIS_URL=redis://redis:6379/0
SIDEKIQ_WORKERS=5
DATABASE_URL=postgres://postgres:postgres@db:5432/projeto_development
- Execute the command below for build image
docker-compose up -d --no-deps --build app
- Execute the command below for start project
docker compose up -d
- Execute the command below for access bash
docker compose run --rm app bash
- Execute the command below for create database
rails db:create
- Execute the command below for migration database
rails db:migrate
- Execute the command below for populate database
rails db:seed
Reset stats sidekiq
Sidekiq::Stats.new.reset
For the test rspec, execute the command below
ENV_FILE=.env.test docker compose run --rm app rspec
For execute rubocop
docker compose run --rm app rubocop
For debug with binding.pry
docker attach --detach-keys="ctrl-c" <id_do_container_app>
Para novos projetos com rails 7 usar o comando abaixo:
Alterar no docker-compose o command do app para chamar pelo
bin/devAlterar o
Procfile.devpara orails serverter o-b '0.0.0.0'