I'm not using this image anymore. I switched from Traefik to Caddy because Traefik is far too complicated for my needs. This image works as it. If you want new features, feel free to fork the project.
A bunch of custom error pages for Traefik built with Jekyll.
Install dependencies
$ bundle install
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/.
Run the container with labels, change with your needs:
# docker-compose.yml
errorpage:
image: guillaumebriday/traefik-custom-error-pages
restart: unless-stopped
networks:
- web
labels:
- traefik.enable: "true"
- traefik.docker.network: "web"
- traefik.http.routers.errorpage.entrypoints: "websecure"
- traefik.http.routers.errorpage.rule: "HostRegexp(`{host:.+}`)"
- traefik.http.services.globalerrorpage.loadbalancer.server.port: "80"
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.
You will find in this article https://www.techjunktrunk.com/docker/2017/11/03/traefik-default-server-catch-all why I set up rule
this way.
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.