An application for tracking board game plays and displaying past results in various statistics (win rates, streakes, best player for game, etc).
- Build the docker images
docker-compose build
- Create a local docker volume for the database using
docker volume create --name data -d local
. This will allow the database data to persist across docker runs. - Boot the app using
docker-compose up
- With the app running from (3), create the database with
docker-compose run web bundle exec rake db:create
, then run any pending database migrations withdocker-compose run web bundle exec rake db:migrate
.
- Boot the app using the steps in bulid/install
- Open another command prompt and run
docker-compose run web rails test
- Boot the app using the steps in bulid/install
- Break the code anywhere by adding the statement
byebug
using the debugger of the same name. - Determine the running container's id by running
docker ps
. This will show an id like063170216bb5
for the web container. - Open another command prompt and attach to the above container using
docker attach <container id>
. - Interact with the app to get to the point being debugged and the above command prompt will break execution.
The database is managed via a dedicated Postgresql docker container, with the data stored locally in a docker volume. Run these steps to get a psql
prompt. Note The steps are for connecting to the development environment.:
- Determine the running docker id for the database container using
docker ps
. This will show an id like063170216bb5
. - Create a bash prompt to the database container via
docker exec -it <container id> bash
- Open a psql prompt using
psql -U postgres
. - Connect to the dev databes using
\c myapp_development
. - Run any query you want, such as
select * from games;
.