From 904e89e325ca9e2d7fe39ce8cbc0ac6b59f838d2 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Fri, 27 Mar 2020 12:17:09 +0100 Subject: [PATCH] Do not reset the dev env when booting docker 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 ` anyway. For someone setting things for the first time, the `Dockerfile` process still installs all dependencies. --- docker-compose.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5025cfd929..f4407eb6a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,10 +28,7 @@ services: ADMIN_PASSWORD: ofn123 OFN_DB_HOST: db command: > - 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 && + bash -c "wait-for-it -t 30 db:5432 && rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"