Skip to content

About

A new website for the Irish Chess Union

Topics

Resources

Stars

3 stars

Watchers

3 watching

Forks

 
 

Repository files navigation

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.

Initial Setup

  1. Copy the Docker database configuration:

    cp config/examples/database-docker.yml config/database.yml
  2. Build the Docker images:

    docker-compose build
  3. Create and setup the database:

    docker-compose run --rm web bundle exec rails db:create db:migrate db:seed

Running the Application

Start all services (web server, MySQL, Redis):

docker-compose up

The application will be available at http://localhost:3000

To run in detached mode:

docker-compose up -d

To stop services:

docker-compose down

Running Tests

Run the full test suite:

docker-compose run --rm -e web bundle exec rspec

Run 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.rb

Run the suite with code coverage (SimpleCov) enabled by setting the COVERAGE env var:

docker-compose run --rm -e COVERAGE=1 web bundle exec rspec

Open coverage/index.html afterwards to view the report. Coverage is off by default since instrumenting it slows down every run.

Useful Commands

Access Rails console:

docker-compose run --rm web bundle exec rails console

Run database migrations:

docker-compose run --rm web bundle exec rails db:migrate

Access bash inside the container:

docker-compose run --rm web bash

View logs:

docker-compose logs -f web

Rebuild after Gemfile changes:

docker-compose build web

Volumes

The Docker setup uses named volumes to persist data:

  • mysql_data - MySQL database files
  • redis_data - Redis data
  • bundle_cache - Bundled gems (speeds up rebuilds)

To reset the database completely:

docker-compose down -v
docker-compose up

About

A new website for the Irish Chess Union

Topics

Resources

Stars

3 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages