Update development docker instructions (#585)

This commit is contained in:
wvengen 2019-02-23 13:55:14 +01:00 committed by wvengen
parent e6e060cab9
commit 9ab54af5ea
2 changed files with 13 additions and 6 deletions

View file

@ -11,7 +11,7 @@ Xvfb $DISPLAY -nolisten tcp &
XVFB_PID=$! XVFB_PID=$!
# Start tests # Start tests
rspec $@ bundle exec rspec $@
# Cleanup # Cleanup
kill $XVFB_PID kill $XVFB_PID

View file

@ -22,10 +22,17 @@ and Windows!
Then setup foodsoft development (this will take some time, containers needs Then setup foodsoft development (this will take some time, containers needs
to be pulled from docker registry and a lot dependencies needs to be installed) to be pulled from docker registry and a lot dependencies needs to be installed)
docker-compose -f docker-compose-dev.yml run foodsoft rake foodsoft:setup_development docker-compose -f docker-compose-dev.yml run --rm foodsoft \
bundle exec rake foodsoft:setup_development
Do not enable mailcatcher, because this is already included as a docker image. Do not enable mailcatcher, because this is already included as a docker image.
Then create an initial database (here seeded with `small.en`) by running
docker-compose -f docker-compose-dev.yml up -d mariadb && sleep 15
docker-compose -f docker-compose-dev.yml run --rm foodsoft \
bundle exec rake db:create db:schema:load db:seed:small.en
To avoid having to pass the `-f` argument all the time, it is recommended to setup To avoid having to pass the `-f` argument all the time, it is recommended to setup
an alias, e.g. by adding the following line to your ~/.bashrc an alias, e.g. by adding the following line to your ~/.bashrc
@ -42,15 +49,15 @@ Start containers (in foreground, stop them with `Ctrl-C`)
Run a rails/rake command Run a rails/rake command
docker-compose-dev run --rm foodsoft rake db:migrate docker-compose-dev run --rm foodsoft bundle exec rake db:migrate
Open a rails console Open a rails console
docker-compose-dev run --rm foodsoft rails c docker-compose-dev run --rm foodsoft bundle exec rails c
Setup the test database Setup the test database
docker-compose-dev run --rm foodsoft rake db:setup RAILS_ENV=test DATABASE_URL=mysql2://root:secret@mariadb/test docker-compose-dev run --rm foodsoft bundle exec rake db:setup RAILS_ENV=test DATABASE_URL=mysql2://root:secret@mariadb/test
Run the tests Run the tests
@ -71,7 +78,7 @@ Go to [http://localhost:1080](http://localhost:1080)
As the gem bundle is stored in a volume, you can run As the gem bundle is stored in a volume, you can run
docker-compose-dev run foodsoft bundle install docker-compose-dev run --rm foodsoft bundle install
docker-compose-dev restart foodsoft foodsoft_worker docker-compose-dev restart foodsoft foodsoft_worker
Do this each time you update your `Gemfile`. Do this each time you update your `Gemfile`.