From f2fcf25f8240ec2898b3ff8e746e60fc4f6de396 Mon Sep 17 00:00:00 2001 From: root Apostolos Date: Thu, 18 Jul 2019 20:20:11 +0300 Subject: [PATCH] traefik-stack docs-labs --- traefik-stack.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++ traefik-stack.yml.sh | 1 + 2 files changed, 52 insertions(+) create mode 100644 traefik-stack.yml create mode 100755 traefik-stack.yml.sh diff --git a/traefik-stack.yml b/traefik-stack.yml new file mode 100644 index 0000000..fe7835b --- /dev/null +++ b/traefik-stack.yml @@ -0,0 +1,51 @@ +version: "3.3" +services: + traefik: + image: traefik + command: --web \ + --docker \ + --docker.swarmMode \ + --docker.domain=swarm \ + --docker.watch \ + --logLevel=DEBUG \ + --api + networks: + - traefik-net + ports: + - "80:80" + - "8080:8080" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /dev/null:/traefik.toml + deploy: + placement: + constraints: + - node.id == ${REGISTERid} + + docs: + image: registry.vlabs.uniwa.gr:5080/vlab-apache2 + networks: + - traefik-net + deploy: + replicas: 1 + placement: + constraints: + - node.id == ${REGISTERid} + labels: + - "traefik.enable=true" + - "traefik.port=80" + - "traefik.docker.network=mystack_traefik-net" + - "traefik.frontend.rule=Host:docs.vlabs.uniwa.gr" + - "traefik.backend=docsswarm" + volumes: + - "/var/lab/html/files:/var/www/html/files" + - "/mnt/web/docs_vlabs:/var/www/html" + - "/mnt/web/docs_vlabs_conf/httpd.conf:/etc/apache2/sites-enabled/000-default.conf" + + +networks: + traefik-net: + +volumes: + portainerdata: + diff --git a/traefik-stack.yml.sh b/traefik-stack.yml.sh new file mode 100755 index 0000000..c40e7ba --- /dev/null +++ b/traefik-stack.yml.sh @@ -0,0 +1 @@ +env REGISTERid=st6ebl5y2kjvgjthq88v6r2fs docker stack deploy -c traefik-stack.yml main