home

Run locally and in Gitlab Pages

12 Mar 2023 - Jan Bernoth

For this site, I have created a local environment via Docker. This is a good starting point for developing local and publishing via automation on the server.

My main purpose is to create a site with GitLab Pages, so this is an additional requirement. The advantages are obvious: there is a GitLab instance at the University of Potsdam, and I don’t need to run my own server to have a site.

I’ve used automation to build and publish the site in GitLab Pages. The tutorial worked well with the little trick to use in every link /my-pages. However, working on little features with a build pipeline is time-consuming. Having a local setup and pushing the running environment is easier.

The best way to do this is to put the software in a docker container. Docker containers are a system-like environment for your software, which solves multiple problems:

  1. The software can be used in different development settings.
  2. You document the runtime environment by its code.

I have found an easy way to set up in a blog post, but it has not worked in my environment. After a little research, I’ve integrated ‘webrick’ into my Gemfile and this works. Now, I can see that my local site runs via ‘http://localhost:4000/my-pages/’ (because my baseurl is set to my-pages).

A good starting point, isn’t it?