This is a Docker container that can be used to display a maintenance page. It is configured
through environment variables in file .env.maintenance
.
TITLE
: the title to show on the pageMESSAGE
: the message to show on the pageMESSAGE_FILE
: if no message is provided, the content of the given message file (html) will be used. The container expects the file to be present in subfoldermaintenance
in the current folder.
The deployment is done in two separate phases: push
and release
.
# On local machine
make deploy.push
# On target
make -f Makefile.maintenance deploy.release
Use the Makefile on the remote server to start, restart and stop the maintenance page server:
make -f Makefile.maintenance docker.run
make -f Makefile.maintenance docker.restart
make -f Makefile.maintenance docker.stop
Copy files from local machine to the server that will host the maintenance page:
scp -P 22 Makefile {username}@{host}:~/Makefile.maintenance
scp -P 22 env.maintenance.sample {username}@{host}:~
See 1Password for details.
cp env.maintenance.sample .env.maintenance
mkdir maintenance
chmod o+x maintenance
Configure the file for your application. The maintenance folder must have permission x
set
for everyone (otherwise nginx will not be able to read from it).
To test the maintenance page locally, you can run the container on your machine:
cp env.maintenance.sample .env.maintenance
Change port to 8080 in file .env.maintenance
make docker.build
make docker.run
open http://localhost:8080
make docker.restart
make docker.stop
- Support SSL requests
- Support multiple ports