Sign inSign up

wickerlabs/maintenance

By wickerlabs

•Updated over 4 years ago

A simple maintenance page in a simple docker image.

Image
2

100K+

wickerlabs/maintenance repository overview

⁠Maintenance

A simple maintenance page in a simple docker image.

Docker Cloud Build Status MicroBadger Downloads MicroBadger Size

⁠Contents

  1. Introduction
    • Environment variables.
  2. Docker.
  3. Docker Compose.
  4. Live demo: Click Here!⁠

⁠Introduction

This image came as a result for the need to place a simple maintenance page in times of server downtime or maintenance. The main requirement was to use a simple static HTML file.

This led us to the gist here⁠. To make it so that it may be fit for most general use cases, We modified some of the elements in the HTML to introduce variables that can be customized for different deployments.

⁠Environment variables

We introduced a few variables that would change different parts of the maintenance page as shown below.

VariableDescription
TITLEModifies the site title displayed. Defaults to Site Maintenance
HEADLINEH1 headline Defaults to We'll be back soon!
MESSAGEPage message Defaults to Sorry for the inconvenience but we're performing some maintenance at the moment. If you need to you can always {{contact}}, otherwise we'll be back online shortly!.

Note: include {{contact}} in your custom message as placeholder for the contact link.
CONTACT_LINKSet the word you want to use instead of the default contact us.
MAIL_ADDRESSThis modifies the email address provided for the contact us link in the page. Defaults to [email protected]
TEAM_NAMEModifies the team or company name displayed on the page. Defaults to The Team
LINK_COLORModifies the link color for the contact us link. Defaults to #dc8100
THEMEModifies page theme current options Light or Dark. Defaults to Light
RESPONSE_CODESpecifies the HTTP response code to serve with the maintenance page. Defaults to 503 Service Unavailable
PORTSpecifies the port to serve the maintenance page. Defaults to 8080

⁠Docker

You can easily run or create a docker container for this image⁠ by using the command:

docker run -p 80:8080 wickerlabs/maintenance

This will serve the default static maintenance page on port 80 of the host machine. You can modify specific variables within the run command which would then look like:

docker run -e TEAM_NAME='Team name' -e TITLE='Oops!' -e [email protected] -e PORT=9000 --rm -p 80:9000 wickerlabs/maintenance

⁠Docker Compose

For docker compose, you can choose to refer to the docker-compose.yml file in the repo⁠ or you can have look at the example below.

version: '3.5'

services:
  maintenance:
    image: wickerlabs/maintenance
    container_name: maintenance-page
    environment:
      TEAM_NAME: "Team name"
      TITLE: "Oops!"
      MAIL_ADDRESS: "[email protected]"
      LINK_COLOR: "#dc8100"
      THEME: "Light"
      PORT: 8080
      RESPONSE_CODE: "503 Service Unavailable"
      MESSAGE: "This is my custom message. {{contact}} now"
      CONTACT_LINK: "contact us"
    ports:
      - 80:8080

Tag summary

Content type

Image

Digest

Size

755.5 kB

Last updated

over 4 years ago

docker pull wickerlabs/maintenance