error-pages/README.md
2020-07-08 20:01:36 +05:00

3.8 KiB

Static error pages in a Docker container

Build Status License

This repository contains a very simple generator for server error pages (like 404: Not found) and ready docker image with web server for error pages serving.

Generator (bin/generator.js) allows you:

  • Use different templates (section templates in configuration file)
  • Generate pages with arbitrary content according to a specific template

Can be used for Traefik error pages customization.

Usage

Just execute (installed nodejs is required):

$ bin/generator.js -c ./configuration.json -o ./out

And watch into ./out directory:

./out
└── ghost
    ├── 400.html
    ├── 401.html
    ├── 403.html
    ├── 404.html
    ├── ...
    └── 505.html

Default configuration can be found in configuration.json file.

Docker

Image size

Start image (nginx inside):

$ docker run --rm -p "8080:8080" tarampampam/error-pages:1.0.0

And open in your browser http://127.0.0.1:8080/ghost/400.html. Additionally, you can set "default" pages theme by passing TEMPLATE_NAME environment variable (eg.: -e "TEMPLATE_NAME=ghost") - in this case all error pages will be accessible in root directory (eg.: http://127.0.0.1:8080/400.html).

Also you can use generated error pages in your own docker images:

FROM nginx:1.18-alpine

COPY --from=tarampampam/error-pages:1.0.0 /opt/html/ghost /usr/share/nginx/html/error-pages

error_page for nginx configuration

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.