Want to see how your blog will turn out before you publish? Just open a PR on your repo and Dockup will spin up a live blog for you!
Assuming that you have a Jekyll blog in place, let's see how we can dockerise it and create a Dockup Blueprint. We are actually using the theme from Jekyll. You can clone/fork from here.
Once we have the source, let's add a couple of files to the root of our project. We will build the Jekyll source and then serve those files with Nginx.
# ============================================================# Build you je kyll blog# ============================================================FROM jekyll/jekyll:stable AS build​RUN mkdir /jekyll-minimaWORKDIR /jekyll-minima​# copy the blog sourceCOPY . .​# permission for bundle to write gemfile.lockRUN chmod 777 ./​# Install dependenciesRUN bundle install​# BuildRUN bundle exec jekyll build​# ============================================================# Serve the build files with NGINX# ============================================================FROM nginx as nginx​COPY nginx.conf /etc/nginx/conf.d/default.conf​# Copy build files of the blogCOPY --from=build /jekyll-minima/_site /usr/share/nginx/html​EXPOSE 80
server {listen 80 default_server;​root /usr/share/nginx/html;index index.html​# how long should static files be cached for,# see http://nginx.org/en/docs/http/ngx_http_headers_module.html for options.expires 1d;}
Now that we have a Dockerfile added to the source, let's create a Dockup Blueprint.
Make sure you have configured you GitHub account with Dockup. If you haven't done it yet, you can head over to Dockup Settings​
And that's all! Wasn't that easy?
Now you can test out your articles against PRs, or you can even apply the same steps in configuring a new theme development altogether!
One another thing to note here is that, you can apply this very same steps to even test other static website generator tools, say for e.g. Hugo.