Go to file
2020-07-09 16:59:14 +05:00
.github/workflows Workflow fixed 2020-07-08 22:56:45 +05:00
bin Improve repository 2020-07-08 22:15:53 +05:00
docker Basic repo files added 2020-07-08 16:12:21 +05:00
static repo renamed 2020-07-08 20:01:36 +05:00
templates Basic repo files added 2020-07-08 16:12:21 +05:00
.dockerignore Basic repo files added 2020-07-08 16:12:21 +05:00
.editorconfig Basic repo files added 2020-07-08 16:12:21 +05:00
.gitignore Basic repo files added 2020-07-08 16:12:21 +05:00
CHANGELOG.md Readme updated 2020-07-08 22:41:41 +05:00
config.json Improve repository 2020-07-08 22:15:53 +05:00
docker-compose.yml Improve repository 2020-07-08 22:15:53 +05:00
Dockerfile Improve repository 2020-07-08 22:15:53 +05:00
LICENSE Basic repo files added 2020-07-08 16:12:21 +05:00
Makefile Improve repository 2020-07-08 22:15:53 +05:00
package.json repo renamed 2020-07-08 20:01:36 +05:00
README.md Update README.md 2020-07-09 16:59:14 +05:00
yarn.lock Basic repo files added 2020-07-08 16:12:21 +05:00

HTTP's error pages in Docker image

Build Status Image size License

This repository contains:

  • A very simple generator (nodejs) for HTTP error pages (like 404: Not found) with different templates supports
  • Dockerfile for docker image with generated pages and nginx as web server

Can be used for Traefik error pages customization.

Demo

Generated pages (from the latest release) always accessible here (sources) and on GitHub pages here.

Development

For project development we use docker-ce + docker-compose. Make sure you have them installed.

Install nodejs dependencies:

$ make install

If you want to generate error pages on your machine (after that look into output directory):

$ make gen

If you want to preview the pages using the Docker image:

$ make preview

Templates

Name Preview
ghost ghost

Usage

Generated error pages in our docker image permanently located in directory /opt/html/%TEMPLATE_NAME%. nginx in container listen for 8080 (http) port.

Supported environment variables

Name Description
TEMPLATE_NAME "default" pages template (allows to use error pages without passing theme name in URL - http://127.0.0.1/500.html instead http://127.0.0.1/ghost/500.html)

HTTP server for error pages serving only

Execute in your shell:

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

And open in your browser http://127.0.0.1:8082/ghost/400.html.

You can build your own docker image with nginx and our error pages:

# File `./nginx.conf`

server {
  listen      80;
  server_name localhost;

  error_page 401 /_error-pages/401.html;
  error_page 403 /_error-pages/403.html;
  error_page 404 /_error-pages/404.html;
  error_page 500 /_error-pages/500.html;
  error_page 502 /_error-pages/502.html;
  error_page 503 /_error-pages/503.html;

  location ^~ /_error-pages/ {
    internal;
    root /usr/share/nginx/errorpages;
  }

  location / {
    root  /usr/share/nginx/html;
    index index.html index.htm;
  }
}
FROM nginx:1.18-alpine

COPY --chown=nginx \
     ./nginx.conf /etc/nginx/conf.d/default.conf
COPY --chown=nginx \
     --from=tarampampam/error-pages:1.0.0 \
     /opt/html/ghost /usr/share/nginx/errorpages/_error-pages

More info about error_page directive can be found here.

Simple traefik service configuration for usage in docker swarm (change with your needs):

# Work in progress

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.