# Maintenance A simple maintenance page in a simple docker image. ## Contents 1. Introduction - Environment variables. 2. Docker. 3. Docker Compose. ## 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. #### Environment variables We introduced a few variables that would change different parts of the maintenance page as shown below. |Variable|Description | |--|--| |`TITLE`|Modifies the site *title* displayed. Defaults to `Site Maintenance`| |`HEADLINE`| H1 headline Defaults to `We'll be back soon!` | |`MESSAGE`| Page 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_LINK`| Set the word you want to use instead of the default `contact us`. | |`MAIL_ADDRESS`| This modifies the email address provided for the *contact us* link in the page. Defaults to `mail@example.com`| |`TEAM_NAME`| Modifies the *team* or *company name* displayed on the page. Defaults to `The Team`| |`LINK_COLOR`|Modifies the link color for the *contact us* link. Defaults to `#dc8100` | |`THEME`|Modifies page theme current options `Light` or `Dark`. Defaults to `Light` |`RESPONSE_CODE`| Specifies the HTTP response code to serve with the maintenance page. Defaults to `503 Service Unavailable` | |`PORT`| Specifies the port to serve the maintenance page. Defaults to `8080` | ## Docker You can easily run or create a docker container for this [image](https://git.libra.bteklabs.com/irul/maintenance) by using the command: `docker run -p 80:8080 git.libra.bteklabs.com/irul/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 MAIL_ADDRESS=mail@domain.com -e PORT=9000 --rm -p 80:9000 git.libra.bteklabs.com/irul/maintenance` ## Docker Compose For docker compose, you can choose to refer to the *docker-compose.yml* file in the [repo](https://git.libra.bteklabs.com/irul/maintenance) or you can have look at the example below. ``` version: '3.5' services: maintenance: image: git.libra.bteklabs.com/irul/maintenance container_name: maintenance-page environment: TEAM_NAME: "Team name" TITLE: "Oops!" MAIL_ADDRESS: "mail@domain.com" 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 ```