A bunch of custom error pages for Traefik built with Jekyll.
Install dependencies
$ bundle install --path vendor/bundle
If you want to build the project on your host:
$ jekyll build
If you want to preview the pages before building the Docker image :
$ jekyll serve
$ open http://127.0.0.1:4000/
Labels are already define in the image to work with Traefik.
To use it in production just run the container :
$ docker run -d --restart always eldorplus/traefik-custom-error-pages
This is a multi-stage build, to build the final image:
$ docker build -f .cloud/docker/Dockerfile -t traefik-custom-error-pages .
As you can see in the Dockerfile, I use Nginx as Web server to serve static files. To generate this pages, I use Jekyll in the first step of the build.
For traefik, I hardcoded Labels in the Dockerfile.
You will find in this article https://www.techjunktrunk.com/docker/2017/11/03/traefik-default-server-catch-all why I set up priority
and rule
this way.
LABEL traefik.frontend.priority="1"
LABEL traefik.frontend.rule="HostRegexp:{catchall:.*}"
It's very useful because this container will respond to all requests only if there is no container with a real rule.
I used the Laravel default HTTP error pages.
Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.
This project is released under the MIT license.