Skip to content

Commit

Permalink
Simplify Docker use 🐳 (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman authored and daattali committed Jan 15, 2018
1 parent 8febf2a commit 81341a4
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 62 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file lists all non-trivial changes to Beautiful Jekyll.

I often make small changes to documentation, to the demo site, or to the general look-and-feel. These changes will not be listed here. Any other minor changes will also not be listed here.

**2018-01-14** Redo Dockerfile (#302) (thanks @jennydaman)

**2018-01-06** More color personalization options (#297 and #299) (thanks @jennydaman)

**2018-01-05** Abstract the social networks logic (thanks @OCram85)
Expand Down
45 changes: 7 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,13 @@
FROM mangar/jekyll:1.0
FROM jekyll/jekyll

MAINTAINER Marcio Mangar "[email protected]"
WORKDIR /srv/jekyll
COPY Gemfile .

RUN gem install jekyll -v 3.1.6
RUN gem install bundler

RUN gem install execjs
RUN gem install therubyracer
RUN gem install github-pages
RUN gem install jekyll-paginate
RUN gem install jekyll-seo-tag
RUN gem install jekyll-gist
RUN gem install json -v 1.8.3

RUN gem install minitest -v 5.9.0
RUN gem install colorator -v 0.1
RUN gem install ffi -v 1.9.10
RUN gem install kramdown -v 1.10.0
RUN gem install rouge -v 1.10.1
RUN gem install pkg-config -v 1.1.7
RUN gem install terminal-table -v 1.6.0
RUN gem install ethon -v 0.9.0
RUN gem install nokogiri -v 1.6.8
RUN gem install activesupport -v 4.2.6
RUN gem install html-pipeline -v 2.4.1
RUN gem install jekyll-watch -v 1.4.0
RUN gem install github-pages-health-check -v 1.1.0
RUN gem install jekyll-github-metadata -v 2.0.0
RUN gem install jekyll-mentions -v 1.1.2
RUN gem install jekyll-redirect-from -v 0.10.0
RUN gem install jemoji -v 0.6.2
RUN gem install github-pages -v 82



RUN mkdir -p /app
ADD ./ /app

WORKDIR /app
RUN bundle install --clean --quiet

EXPOSE 4000

CMD bundle exec jekyll serve
CMD [ "/usr/gem/bin/bundle", "exec", "/usr/local/bundle/bin/jekyll", "serve", "--port", "4000", "--host", "0.0.0.0" ]

STOPSIGNAL 2
28 changes: 15 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ GEM
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
ethon (0.10.1)
concurrent-ruby (1.0.5)
ethon (0.11.0)
ffi (>= 1.3.0)
execjs (2.7.0)
faraday (0.13.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.18-x64-mingw32)
ffi (1.9.18)
forwardable-extended (2.6.0)
gemoji (3.0.0)
github-pages (163)
Expand Down Expand Up @@ -72,7 +73,8 @@ GEM
html-pipeline (2.7.1)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.8.6)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
jekyll (3.5.2)
addressable (~> 2.4)
colorator (~> 1.0)
Expand Down Expand Up @@ -160,8 +162,8 @@ GEM
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.4.0)
jekyll (~> 3.3)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
jekyll-watch (1.5.1)
listen (~> 3.0)
jemoji (0.8.1)
activesupport (~> 4.0, >= 4.2.9)
gemoji (~> 3.0)
Expand All @@ -176,22 +178,22 @@ GEM
mini_portile2 (2.3.0)
minima (2.1.1)
jekyll (~> 3.3)
minitest (5.10.3)
minitest (5.11.1)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.8.1-x64-mingw32)
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
octokit (4.7.0)
octokit (4.8.0)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.0)
pathutil (0.16.1)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.5.2)
sass (3.5.5)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -204,16 +206,16 @@ GEM
thread_safe (0.3.6)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.3)
tzinfo (1.2.4)
thread_safe (~> 0.1)
unicode-display_width (1.3.0)

PLATFORMS
x64-mingw32
ruby

DEPENDENCIES
github-pages (= 163)
jekyll-paginate

BUNDLED WITH
1.15.1
1.16.1
49 changes: 38 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,47 @@ Want your website featured here? [Contact me](http://deanattali.com/aboutme#cont

## Advanced: Local development using Docker

Beautiful Jekyll is meant to be so simple to use that you can do it all within the browser. However, if you'd like to develop locally on your own machine, that's possible too if you're comfortable with command line. Follow these simple steps to do that with Docker:
First, clone your repository locally.

1. Make sure that you have Docker installed on your local environment. Installation instructions can be found [here](https://docs.docker.com/engine/installation/)
2. Clone your fork `git clone [email protected]:yourusername/yourusername.github.io.git`
3. Inside your repository folder, run:
```bash
git clone https://github.com/<your_username>/<your_username>.github.io.git
```

Make sure you have Docker installed. https://www.docker.com/community-edition

### First-time setup

```bash
# 1. change directory
cd <folder>
# 2. Build the docker image
docker build -t beautiful-jekyll $PWD
# 3. Start the container for the first time
docker run -d -p 4000:4000 --name beautiful-jekyll -v $PWD:/srv/jekyll beautiful-jekyll
```

You can now view your website at http://localhost:4000/.

After the container is running, you can stop the server simply with the command

```bash
docker stop beautiful-jekyll
```

To start a container again (after you've already created it)

```bash
docker start beautiful-jekyll
```

If you change `_config.yml`, you must restart the server for jekyll to rebuild the site.

```bash
docker restart beautiful-jekyll
```

```
docker run -p 4000:4000 -v `pwd`:/app mangar/jekyll:1.1 bash -c "bundle install; bundle exec jekyll serve"
```
Note you may need to add `--host 0.0.0.0` after `bundle exec jekyll serve` to get the site to server correctly.
4. View your website at <http://localhost:4000>.
Disclaimer: I personally am NOT using local development so I don't know much about running Jekyll locally. If you follow this route, please don't ask me questions because unfortunately I honestly won't be able to help!

Disclaimer: I personally am NOT using local development so I don't know much about running Jekyll locally. If you follow this route, please don't ask me questions because unfortunately I honestly won't be able to help!

Aditionally, if you choose to deploy Jekyll using a local ruby installation, you can tell Jekyll to automatically categorize your blog posts by tags. You just need to set `link-tags: true` in `_config.yml`. Jekyll will then generate a new page for each unique tag which lists all of the posts that belong to that tag.

## FAQ
Expand Down

0 comments on commit 81341a4

Please sign in to comment.