Skip to content

Instantly share code, notes, and snippets.

@marcelo-ochoa
Created May 23, 2018 14:20
Show Gist options
  • Save marcelo-ochoa/09bad99872a0bc1a4b68a6b691016eda to your computer and use it in GitHub Desktop.
Save marcelo-ochoa/09bad99872a0bc1a4b68a6b691016eda to your computer and use it in GitHub Desktop.
Load Balancer (HAProxy) and Swarm Scheduler stacks
# Cada 1 hora
0 * * * * root run-task mon_cron
# Domigo 2:30am GLPI 7606
30 2 * * 0 root run-task letsencrypt_renew
# Domigo 1:30am GLPI 7751
30 1 * * 0 root run-task registry_purge
# Define or paste the content of your docker-compose file here
version: '3.3'
services:
server:
image: dockercloud/haproxy:1.6.7
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- proxy_certs:/certs
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
networks:
- rproxy
environment:
- TZ=America/Argentina/Buenos_Aires
- TIMEOUT=connect 50000, client 50000, server 50000
- CERT_FOLDER="/certs/"
- RSYSLOG_DESTINATION=10.1.1.243
deploy:
mode: replicated
replicas: 2
placement:
constraints: [node.role == manager]
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
networks:
rproxy:
external:
name: reverse_proxy
version: '3.3'
services:
manager:
image: rayyanqcri/swarm-scheduler
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DOCKER_URL=unix:///var/run/docker.sock
- TZ=America/Argentina/Buenos_Aires
configs:
- source: crontab_dc.7751
target: /crontab
deploy:
placement:
constraints:
- node.role == manager
configs:
crontab_dc.7751:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment