Repository navigation
Expand file tree
/
Copy pathdocker-compose.maintenance.yml
More file actions
38 lines (35 loc) · 1.77 KB
/
Copy pathdocker-compose.maintenance.yml
File metadata and controls
38 lines (35 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Maintenance page: "Trading has been paused. Please check back later"
#
# A static nginx whose Traefik router claims the same hosts as the app at a
# higher priority, so while it is up every request — pages and /api/v1 alike,
# so no order can be placed — gets a 503 with maintenance/index.html (JSON
# under /api/). The app, its database and the host crons are not touched;
# taking this down hands the hosts straight back to the app.
#
# docker compose -f docker-compose.maintenance.yml up -d # pause
# docker compose -f docker-compose.maintenance.yml down # resume
#
# MAINTENANCE_RULE picks the hosts; try it on staging first with
# MAINTENANCE_RULE='Host(`staging.acceptodds.com`)' docker compose -f docker-compose.maintenance.yml -p acceptodds-maintenance-staging up -d
name: acceptodds-maintenance
services:
maintenance:
image: nginx:1.27-alpine
restart: unless-stopped
volumes:
- ./maintenance/index.html:/usr/share/nginx/html/index.html:ro
- ./maintenance/nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- web
labels:
- traefik.enable=true
- traefik.docker.network=web
- 'traefik.http.routers.${COMPOSE_PROJECT_NAME:-acceptodds-maintenance}.rule=${MAINTENANCE_RULE:-Host(`acceptodds.com`) || Host(`www.acceptodds.com`)}'
- traefik.http.routers.${COMPOSE_PROJECT_NAME:-acceptodds-maintenance}.entrypoints=websecure
- traefik.http.routers.${COMPOSE_PROJECT_NAME:-acceptodds-maintenance}.tls=true
# Above the app's router, whose priority defaults to its rule's length.
- traefik.http.routers.${COMPOSE_PROJECT_NAME:-acceptodds-maintenance}.priority=10000
- traefik.http.services.${COMPOSE_PROJECT_NAME:-acceptodds-maintenance}.loadbalancer.server.port=80
networks:
web:
external: true