Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Maintenance
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
docker
Maintenance
Commits
f192e433
Verified
Commit
f192e433
authored
7 months ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Kill maintenance mode after timeout
parent
8c33c101
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.env.sample
+2
-0
2 additions, 0 deletions
.env.sample
docker-compose.yml
+3
-1
3 additions, 1 deletion
docker-compose.yml
docker/Dockerfile
+5
-0
5 additions, 0 deletions
docker/Dockerfile
docker/entrypoint.sh
+13
-0
13 additions, 0 deletions
docker/entrypoint.sh
with
23 additions
and
1 deletion
.env.sample
+
2
−
0
View file @
f192e433
# TIMEOUT in minutes after which the service will automatically stop, 90 minutes if not set
TIMEOUT=
# Hosts to put down ex `dev.tetras-lab.io`,`reporting.tetras-lab.io`
# Hosts to put down ex `dev.tetras-lab.io`,`reporting.tetras-lab.io`
HOSTS=
HOSTS=
# Hosts to put down ex `127.0.0.1`,`109.190.86.26`
# Hosts to put down ex `127.0.0.1`,`109.190.86.26`
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
3
−
1
View file @
f192e433
...
@@ -2,7 +2,7 @@ version: '3'
...
@@ -2,7 +2,7 @@ version: '3'
services
:
services
:
maintenance
:
maintenance
:
image
:
nginx
build
:
docker
volumes
:
volumes
:
-
"
./www:/usr/share/nginx/html:ro"
-
"
./www:/usr/share/nginx/html:ro"
-
"
./nginx.conf:/etc/nginx/nginx.conf:ro"
-
"
./nginx.conf:/etc/nginx/nginx.conf:ro"
...
@@ -16,6 +16,8 @@ services:
...
@@ -16,6 +16,8 @@ services:
-
"
traefik.http.routers.maintenance.entrypoints=web,websecure"
-
"
traefik.http.routers.maintenance.entrypoints=web,websecure"
-
"
traefik.http.routers.maintenance.middlewares=hardening@docker"
-
"
traefik.http.routers.maintenance.middlewares=hardening@docker"
-
"
traefik.http.routers.maintenance.priority=99999"
-
"
traefik.http.routers.maintenance.priority=99999"
environment
:
TIMEOUT
:
networks
:
networks
:
traefik
:
traefik
:
...
...
This diff is collapsed.
Click to expand it.
docker/Dockerfile
0 → 100644
+
5
−
0
View file @
f192e433
FROM
nginx:latest
COPY
entrypoint.sh /entrypoint.sh
ENTRYPOINT
'/entrypoint.sh'
This diff is collapsed.
Click to expand it.
docker/entrypoint.sh
0 → 100755
+
13
−
0
View file @
f192e433
#!/bin/bash
if
[
-z
"
$TIMEOUT
"
]
;
then
TIMEOUT
=
90
fi
/docker-entrypoint.sh
$@
&
while
[[
$TIMEOUT
-gt
0
]]
;
do
echo
"Maintenance system is up, timeout in
$TIMEOUT
minutes"
sleep
60
TIMEOUT
=
$((
$TIMEOUT
-
1
))
done
exit
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment