Skip to content

Commit 1b5ba79

Browse files
Update README.md
1 parent 8eb4969 commit 1b5ba79

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/guillaumebriday)
2-
[![Docker Automated build](https://img.shields.io/docker/automated/guillaumebriday/traefik-custom-error-pages.svg)](https://hub.docker.com/r/guillaumebriday/traefik-custom-error-pages/)
32
[![Docker Pulls](https://img.shields.io/docker/pulls/guillaumebriday/traefik-custom-error-pages.svg)](https://hub.docker.com/r/guillaumebriday/traefik-custom-error-pages/)
43
[![Docker Stars](https://img.shields.io/docker/stars/guillaumebriday/traefik-custom-error-pages.svg)](https://hub.docker.com/r/guillaumebriday/traefik-custom-error-pages/)
54
[![Netlify Status](https://api.netlify.com/api/v1/badges/64de9cea-fa16-4f76-b5b8-a1abb5eb4e2f/deploy-status)](https://app.netlify.com/sites/traefik-custom-error-pages/deploys)
@@ -10,29 +9,22 @@ A bunch of custom error pages for Traefik built with [Jekyll](https://jekyllrb.c
109

1110
## Installation
1211

12+
Install dependencies
1313
```bash
1414
$ bundle install
1515
```
1616

17-
## Development
18-
19-
The current folder will be generated into ./_site :
17+
If you want to build the project on your host:
2018
```bash
2119
$ jekyll build
2220
```
2321

24-
Build the site on the preview server :
22+
If you want to preview the pages before building the Docker image :
2523
```bash
2624
$ jekyll serve
2725
$ open http://127.0.0.1:4000/
2826
```
2927

30-
## Production
31-
32-
You can use this project in production with Netlify:
33-
34-
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/guillaumebriday/traefik-custom-error-pages)
35-
3628
## How to use with Traefik and Docker
3729

3830
Labels are already define in the image to work with Traefik.
@@ -43,6 +35,28 @@ To use it in production just run the container :
4335
$ docker run -d --restart always guillaumebriday/traefik-custom-error-pages
4436
```
4537

38+
## Build the image
39+
40+
This is a [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/), to build the final image:
41+
```bash
42+
$ docker build -f .cloud/docker/Dockerfile -t traefik-custom-error-pages .
43+
```
44+
45+
## How it works?
46+
47+
As you can see in the Dockerfile, I use [Nginx](https://www.nginx.com/) as Web server to serve static files. To generate this pages, I use [Jekyll](https://jekyllrb.com/) in the first step of the build.
48+
49+
For traefik, I hardcoded [Labels](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/#labels) in the Dockerfile.
50+
51+
You will find in this article [https://www.techjunktrunk.com/docker/2017/11/03/traefik-default-server-catch-all](https://www.techjunktrunk.com/docker/2017/11/03/traefik-default-server-catch-all/] why I set up `priority` and `rule` this way.
52+
53+
```ini
54+
LABEL traefik.frontend.priority="1"
55+
LABEL traefik.frontend.rule="HostRegexp:{catchall:.*}"
56+
```
57+
58+
It's very useful because this container will respond to all requests only if there is no container with a real rule.
59+
4660
## Credits
4761

4862
I used the [Laravel](https://laravel.com/) default HTTP error pages.

0 commit comments

Comments
 (0)