-
-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not reset the dev env when booting docker #5088
Do not reset the dev env when booting docker #5088
Conversation
The current web container's command destroys anything you might have in your local DB from a previous session, assuming you always want start from a clean environment. This is hardly the case and makes `docker-compose up` take quite long. What if you just stopped containers temporally while developing? This changes the approach to not assume anything. If you need to install a new gem or reset your DB just run the commands you would without docker. You can run anything you want with `docker-compose run web bundle exec <rails/rake command>` anyway. For someone setting things for the first time, the `Dockerfile` process still installs all dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice.
needs to be tested for a first timer. I can do that when it gets to test ready.
bash -c "(bundle check || bundle install) && | ||
wait-for-it -t 30 db:5432 && | ||
bundle exec rake db:reset && | ||
bundle exec rake db:test:prepare ofn:sample_data || true && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the test db and sample data won't be loaded when it's first used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I don't have Docker set up, but I trust you so I'll slap the Approve button anyway.
Assuming Luis will test it.
this is not working for a fresh setup, we need to re-add the initial setup instructions somewhere. |
…cker Re-add setup instructions removed from docker-compose into Dockerfile…
What? Why?
The current web container's command destroys anything you might have in your local DB from a previous session, assuming you always want to start from a clean environment. This is hardly the case and makes
docker-compose up
take quite long. What if you just stopped containers temporally while developing? All the sample orders you created are gone 🙈This changes the approach to not assume anything. If you need to install a new gem or reset your DB just run the commands you would without docker. You can run anything you want with
docker-compose run web bundle exec <rails/rake command>
anyway.For someone setting things for the first time, the
Dockerfile
process still installs all dependencies.What should we test?
Nothing. I know it works because I always comment out these lines.
Release notes
Do not reset the development environment when starting docker
Changelog Category: Changed