dockerizing site setup
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal 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"]
|
||||
|
2
Gemfile
2
Gemfile
@ -1,5 +1,5 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
# gem "rails"
|
||||
gem 'github-pages'
|
||||
# gem 'github-pages'
|
||||
gem 'jekyll'
|
16
README.md
16
README.md
@ -1,3 +1,19 @@
|
||||
## 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/)
|
||||
|
||||
## 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.
|
||||
|
||||
|
@ -20,7 +20,7 @@ disqus_shortname: idrbwjekyll
|
||||
host: 127.0.0.1
|
||||
# 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.
|
||||
|
||||
exclude:
|
||||
|
Reference in New Issue
Block a user