This is the source code for version 2 of the Irish Chess Union's web site, www.icu.ie.
See the wiki for instructions on how to setup and maintain the server and application software.
-
Copy the Docker database configuration:
cp config/examples/database-docker.yml config/database.yml
-
Build the Docker images:
docker-compose build
-
Create and setup the database:
docker-compose run --rm web bundle exec rails db:create db:migrate db:seed
Start all services (web server, MySQL, Redis):
docker-compose upThe application will be available at http://localhost:3000
To run in detached mode:
docker-compose up -dTo stop services:
docker-compose downRun the full test suite:
docker-compose run --rm -e web bundle exec rspecRun specific tests:
docker-compose run --rm test bundle exec rspec spec/models/
docker-compose run --rm test bundle exec rspec spec/features/some_feature_spec.rbRun the suite with code coverage (SimpleCov) enabled by setting the COVERAGE env var:
docker-compose run --rm -e COVERAGE=1 web bundle exec rspecOpen coverage/index.html afterwards to view the report. Coverage is off by default since instrumenting it slows down every run.
Access Rails console:
docker-compose run --rm web bundle exec rails consoleRun database migrations:
docker-compose run --rm web bundle exec rails db:migrateAccess bash inside the container:
docker-compose run --rm web bashView logs:
docker-compose logs -f webRebuild after Gemfile changes:
docker-compose build webThe Docker setup uses named volumes to persist data:
mysql_data- MySQL database filesredis_data- Redis databundle_cache- Bundled gems (speeds up rebuilds)
To reset the database completely:
docker-compose down -v
docker-compose up