Public Repository

Last pushed: a year ago
Short Description
[Warning] This docker image is deprecated on 09/20/2017, new version "winbobob/expertiza" -Zhewei
Full Description

[Warning] This docker image is deprecated on 09/20/2017, new version is winbobob/expertiza, which is part of docker-compose.

If you think it is useful, please star this repo. Happy coding! XD


Expertiza is a web application where students can submit and peer-review learning objects (articles, code, websites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.

Install Docker

Docker Engine is supported on Linux, Cloud, Windows, and OS X. Please follow the corresponding installation instruction.

Download Docker image

docker pull winbobob/expertiza-fall2016

Run Docker image

  • Option 1

    docker run --expose 3000 -p 3000:3000 -it winbobob/expertiza-fall2016

    The command above expose the port 3000 in docker image and map it to port 3000 on the host machine.

  • Option 2 (recommended)

    docker run --expose 3000 -p 3000:3000 -v /my/forked/expertiza/dir:/root/expertiza -it winbobob/expertiza-fall2016

    The command above not only finishes port mapping but also mounts the current working directory into the container.
    In order to run the option 2 command, you have to fork the expertiza repository first and git clone the forked repository to your host machine.
    /my/forked/expertiza/dir represents the path on the host machine, you can change it if you want. And /root/expertiza represents the path in the container. You can also change it. Be careful, both paths should be absolute paths.

  • Advantages of Option 2
    Option 2 mounts the code from the host machine. It means you can use your favorite IDE or editor (Emacs, Sublime, Atom, etc) to modify the code and run the code in the docker container. In this way, you do not need to worry about that if you exit the docker container accidently and all uncommitted code are gone since the code are actually stored on your host machine.
    However, if you are fancy enough and used to editing and debugging in the terminal, option 1 is also OK.

Check everything works well

Once you successfully enter the docker container, you have to check the version of ruby and rails, and also start the MySQL service. Commands are listed below.

ruby -v                   #=> ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
rails -v                  #=> Rails 4.2.6
/etc/init.d/mysql start   #=> Start MySQL service
mysql -uroot -p           #=> Enter MySQL, no password, you can set one if you want
show databases;           #=> You should see expertiza_development DB

Config Expertiza

No matter in docker container or host machine, you need to git clone the forked Expertiza repository. Be careful, clone the forked repository instead of git clone directly. It is because, ​after modification, you need to make a pull request Expertiza master branch. Commands are listed below.

git clone [your repo url]
cd expertiza
cp config/database.yml.example config/database.yml
cp config/secrets.yml.example config/secrets.yml
rake db:migrate
bundle install
sudo apt-get install npm
sudo npm install bower
bower install

Run Expertiza

Command rails s OR thin start.
After the server is up, you should access Expertiza using host machine's browser via
Instructor account: instructor6, password password;
Student account: student5432, password password.
You can find more usernames in Users table, and all passwords are password.

Common commands

docker images                  #=> check all downloaded docker images
docker ps                      #=> check all running docker container
docker attach [container_id]   #=> Attach running container
docker stop [container_id]     #=> Stop running container

If you have any questions, please post on Piazza!

Docker Pull Command