From fb2f91f8159113888dd1dcf08df4dda65d16fddb Mon Sep 17 00:00:00 2001 From: tiagostutz Date: Fri, 5 Jun 2020 21:13:16 -0300 Subject: [PATCH] separeted tls and non-tls --- docker-compose.yml | 10 ---------- Dockerfile => non-tls/Dockerfile | 0 non-tls/docker-compose.yml | 21 +++++++++++++++++++++ non-tls/startup.sh | 12 ++++++++++++ tls/Dockerfile | 4 ++++ tls/docker-compose.yml | 21 +++++++++++++++++++++ startup.sh => tls/startup.sh | 2 +- 7 files changed, 59 insertions(+), 11 deletions(-) delete mode 100644 docker-compose.yml rename Dockerfile => non-tls/Dockerfile (100%) create mode 100644 non-tls/docker-compose.yml create mode 100755 non-tls/startup.sh create mode 100644 tls/Dockerfile create mode 100644 tls/docker-compose.yml rename startup.sh => tls/startup.sh (97%) diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index eba5e02..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3.5' - -services: - traefik-letsencrypt: - image: tiagostutz/traefik-letsencrypt:local - build: . - ports: - - 80:80 - - 443:443 - - 8080:8080 \ No newline at end of file diff --git a/Dockerfile b/non-tls/Dockerfile similarity index 100% rename from Dockerfile rename to non-tls/Dockerfile diff --git a/non-tls/docker-compose.yml b/non-tls/docker-compose.yml new file mode 100644 index 0000000..9acf7da --- /dev/null +++ b/non-tls/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.5' + +services: + traefik-letsencrypt: + image: tiagostutz/traefik-letsencrypt:non-tls-1.7-alpine + build: . + deploy: + mode: global + labels: + - traefik.enable=false + placement: + constraints: + - node.role == manager + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + - LOG_LEVEL=DEBUG + ports: + - 80:80 + - 443:443 + - 8080:8080 \ No newline at end of file diff --git a/non-tls/startup.sh b/non-tls/startup.sh new file mode 100755 index 0000000..0359635 --- /dev/null +++ b/non-tls/startup.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ -z $SWARM_MODE ]; then + SWARM_MODE=false +fi + +traefik --api --docker --docker.watch --docker.domain=docker.localhost --docker.swarmMode=$SWARM_MODE \ +--ping --ping.entryPoint=http \ +--metrics.prometheus \ +--entrypoints='Name:http Address::80' \ +--retry \ +--loglevel=$LOG_LEVEL diff --git a/tls/Dockerfile b/tls/Dockerfile new file mode 100644 index 0000000..22ad398 --- /dev/null +++ b/tls/Dockerfile @@ -0,0 +1,4 @@ +FROM traefik:1.7-alpine + +ADD startup.sh /startup.sh +CMD ["/startup.sh"] \ No newline at end of file diff --git a/tls/docker-compose.yml b/tls/docker-compose.yml new file mode 100644 index 0000000..7a89327 --- /dev/null +++ b/tls/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.5' + +services: + traefik-letsencrypt: + image: tiagostutz/traefik-letsencrypt:tls-1.7-alpine + build: . + deploy: + mode: global + labels: + - traefik.enable=false + placement: + constraints: + - node.role == manager + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + - LOG_LEVEL=DEBUG + ports: + - 80:80 + - 443:443 + - 8080:8080 \ No newline at end of file diff --git a/startup.sh b/tls/startup.sh similarity index 97% rename from startup.sh rename to tls/startup.sh index 3565b46..dba083c 100755 --- a/startup.sh +++ b/tls/startup.sh @@ -25,4 +25,4 @@ traefik --api --docker --docker.watch --docker.domain=docker.localhost --docker --acme.onhostrule --acme.httpchallenge \ --acme.httpchallenge.entrypoint=http \ --retry \ ---loglevel=DEBUG +--loglevel=$LOG_LEVEL