Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Docker instructions to README #842

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ AIMA exercises is an interactive and collaborative platform for digitalizing the
Exercises for the book [*Artificial Intelligence: A Modern Approach.*](http://aima.cs.berkeley.edu/) The idea is that in the fourth edition of the book, exercises will be online only (they will not appear in the book). This site will showcase the exercises, and will be a platform for students and teachers to add new exercises.
<br>
The present version of AIMA-Exercises uses Jekyll 3 and Ruby 2.5.
**To run the project locally**:

## To run the project locally

### Option 1: Install Jekyll
1. Install a full [Ruby development environment](https://jekyllrb.com/docs/installation/)
2. Install Jekyll and [bundler gems](https://jekyllrb.com/docs/ruby-101/#bundler)
3. Installation Guides:
Expand All @@ -17,7 +20,37 @@ The present version of AIMA-Exercises uses Jekyll 3 and Ruby 2.5.
6. `gem install Jekyll bundler `
7. `bundle exec Jekyll serve`

**The directory structure is as follows:**
### Option 2: Use Docker

1. Install Docker
- [MacOS](https://docs.docker.com/desktop/install/mac-install/)
- [Linux](https://docs.docker.com/desktop/install/linux-install/)
- [Windows](https://docs.docker.com/desktop/install/windows-install/)
2. Clone the project locally.
3. Go to the folder directory where you cloned the project in the terminal.
4. Build the site
```shell
docker run --rm -it \
--volume="{current-directory}:/srv/jekyll:Z" \
--volume="{current-directory}/vendor:/usr/local/bundle:Z" \
jekyll/jekyll:3.8 \
jekyll build
```
4. Serve the site
```shell
docker run --rm \
-it \
--publish 4000:4000 \
--volume="{current-directory}:/srv/jekyll:Z" \
--volume="{current-directory}/vendor:/usr/local/bundle:Z" \
jekyll/jekyll:3.8 \
jekyll serve --port 4000
```

Replace `{current-directory}` with the full path to the current directory.
On Linux, you can use the environment variable `${PWD}`.

## The directory structure is as follows:
* `_includes` - The include tag allows you to include the content from another file stored in the `_includes` folder and contains reusable files like `staticman_comments.html` which is the form used for submitting answers. Sidebar templates, head.html, and breadcrumb.
* `_layouts` - They allow you to have the source code for project template in one place so you don’t have to repeat things like your navigation and footer on every page. The layouts folder has default layout, homepage layout, exercise layout, answer submitted layout and others.
* `_site` - This is where the generated site is placed (by default) once Jekyll is done transforming it. While contributing, don't change files in the `_site` directory as Github Pages is compatible with Jekyll and `_site` folder is updated every time the root directory folders are changed.
Expand Down