-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-stack.yml
45 lines (43 loc) · 1.65 KB
/
docker-stack.yml
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
39
40
41
42
43
44
45
version: '3.7'
services:
app:
image: '${DOCKER_IMAGE}'
networks:
- cluster
volumes:
- '/etc/localtime:/etc/localtime:ro'
- '/etc/timezone:/etc/timezone:ro'
logging:
driver: loki
options:
loki-url: '${LOKI_URL}'
loki-external-labels: 'job=logs,logs_provider=morgan,traefik_service=${TRAEFIK_NAME}@docker'
loki-pipeline-stage-file: '${LOKI_PIPELINE_STAGE_FILE}'
deploy:
mode: global
placement:
constraints:
- 'node.hostname == ${DOCKER_STACK_NODE_HOSTNAME}'
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
labels:
# Traefik (General)
- 'traefik.enable=true'
# Traefik (Services)
- 'traefik.http.services.${TRAEFIK_NAME}.loadbalancer.server.port=8080'
# Traefik (Routers - HTTP)
- 'traefik.http.routers.${TRAEFIK_NAME}-http.entrypoints=web'
- 'traefik.http.routers.${TRAEFIK_NAME}-http.middlewares=github-http'
- 'traefik.http.routers.${TRAEFIK_NAME}-http.rule=Host(`${TRAEFIK_HOSTNAME}`) && PathPrefix(`${TRAEFIK_PATH_PREFIX}`)'
- 'traefik.http.routers.${TRAEFIK_NAME}-http.service=${TRAEFIK_NAME}'
# Traefik (Routers - HTTPS)
- 'traefik.http.routers.${TRAEFIK_NAME}-https.entrypoints=websecure'
- 'traefik.http.routers.${TRAEFIK_NAME}-https.middlewares=github-https'
- 'traefik.http.routers.${TRAEFIK_NAME}-https.rule=Host(`${TRAEFIK_HOSTNAME}`) && PathPrefix(`${TRAEFIK_PATH_PREFIX}`)'
- 'traefik.http.routers.${TRAEFIK_NAME}-https.service=${TRAEFIK_NAME}'
networks:
cluster:
external: true