diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..a274a3c5f9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ruby:2.1 + +MAINTAINER Maxence POUTORD + +RUN apt-get update + +# Install bundle of gems +WORKDIR /tmp +COPY Gemfile /tmp/ +RUN bundle install + +# Copy site into +VOLUME /site +WORKDIR /site +COPY . /site + +EXPOSE 4000 + +ENTRYPOINT ["jekyll", "serve"] diff --git a/_config.yml b/_config.yml index 4bc7487212..e0b0c68c3a 100644 --- a/_config.yml +++ b/_config.yml @@ -78,4 +78,4 @@ page_layout: page titlecase: true include: [".htaccess"] -exclude: ["lib", "config.rb", "Capfile", "config", "Gemfile", "Gemfile.lock", "README.md", "LICENSE", "log", "Rakefile", "Rakefile.rb", "tmp", "less", "*.sublime-project", "*.sublime-workspace", "test", "spec", "Gruntfile.js", "package.json", "node_modules"] +exclude: ["lib", "config.rb", "Capfile", "config", "Gemfile", "Gemfile.lock", "README.md", "LICENSE", "log", "Rakefile", "Rakefile.rb", "tmp", "less", "*.sublime-project", "*.sublime-workspace", "test", "spec", "Gruntfile.js", "package.json", "node_modules", "Dockerfile"] diff --git a/theme-setup/index.md b/theme-setup/index.md index c54611940c..d19df23f94 100644 --- a/theme-setup/index.md +++ b/theme-setup/index.md @@ -53,6 +53,31 @@ bundle exec jekyll serve --- +## Running into a Docker container + +*Replace `username` with your GitHub account.* + +1. Build container: + + ``` + docker build -t username/username.github.io --no-cache . + ``` + +2. Run container: + + ``` + docker run --rm -v $PWD:/site -p 4000:4000 username/username.github.io -H 0.0.0.0 --draft + ``` + +3. Retrieve IP adress: + + ``` + docker inspect -f '{{ .NetworkSettings.IPAddress }}' $(docker ps -f ancestor=username/username.github.io -q) + ``` + +4. Visit `http://:4000` + + ## Folder Structure {% highlight bash %}