Copy ENV
cp .env.example .env
Build
docker compose -f docker-compose.dev.yml build
Spawn containers
docker compose -f docker-compose.dev.yml up -d
We control all the commands inside our time_tracker_container. All logic or changes will reflect in our project directory because volume are shared between our container
Local server (this is served from our docker container)
http://127.0.0.1:3000/
Open rails project container
docker exec -it time_tracker_container bash
After successful docker container execution we can now run rails commands on it
Execution (Example Only)
root@a122740347d3:/app# rails console
Loading development environment (Rails 7.0.8.1)
irb(main):001> User.all
Admin User
email: [email protected]
password: test@123
Normal User
email: [email protected]
password: test@123
HAML_RAILS_DELETE_ERB=true rails haml:erb2haml