dockerizing site setup

This commit is contained in:
Mohammad Rafay Aleem
2016-09-04 17:16:10 +04:00
parent debb57f247
commit 4ff130f138
4 changed files with 45 additions and 3 deletions

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM ruby:2.1
MAINTAINER mrafayaleem@gmail.com
RUN apt-get clean \
&& mv /var/lib/apt/lists /var/lib/apt/lists.broke \
&& mkdir -p /var/lib/apt/lists/partial
RUN apt-get update
RUN apt-get install -y \
node \
python-pygments \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
WORKDIR /tmp
ADD Gemfile /tmp/
ADD Gemfile.lock /tmp/
RUN bundle install
VOLUME /src
EXPOSE 4000
WORKDIR /src
ENTRYPOINT ["jekyll"]

View File

@ -1,5 +1,5 @@
source "https://rubygems.org" source "https://rubygems.org"
# gem "rails" # gem "rails"
gem 'github-pages' # gem 'github-pages'
gem 'jekyll' gem 'jekyll'

View File

@ -1,3 +1,19 @@
## Jekyll Documentation theme ## Jekyll Documentation theme
Build the site to see the instructions for using it. Or just go here: [http://idratherbewriting.com/documentation-theme-jekyll/](http://idratherbewriting.com/documentation-theme-jekyll/) Build the site to see the instructions for using it. Or just go here: [http://idratherbewriting.com/documentation-theme-jekyll/](http://idratherbewriting.com/documentation-theme-jekyll/)
## Running the site in Docker
You can also use Docker to directly build and run the site on your local machine. Just clone the repo and run the following from your working dir:
```
docker build --no-cache -t mydocs .
```
Once the build is complete, you can mount and run the whole site as follows:
```
docker run -v "$PWD:/src" -p 4000:4000 mydocs serve -H 0.0.0.0
```
This is perhaps the easiest way to see how your site would actually look.

View File

@ -20,7 +20,7 @@ disqus_shortname: idrbwjekyll
host: 127.0.0.1 host: 127.0.0.1
# the preview server used. Leave as is. # the preview server used. Leave as is.
port: 4005 port: 4000
# the port where the preview is rendered. You can leave this as is unless you have other Jekyll builds using this same port that might cause conflicts. in that case, use another port such as 4006. # the port where the preview is rendered. You can leave this as is unless you have other Jekyll builds using this same port that might cause conflicts. in that case, use another port such as 4006.
exclude: exclude: