WIP: broken, doesn't work.

master
josiah 4 years ago
parent 5bb2adfaf7
commit 6283f5db0c

@ -5,12 +5,13 @@
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
mode: 0777 mode: 0777
with_items: with_items:
- {src: 'test-compose.yml', dest: '/home/josiah/apps/traefik/docker-compose.yml'} - {src: 'test-compose.yml', dest: '/home/josiah/apps/test/docker-compose.yml'}
- {src: 'traefik.toml', dest: '/home/josiah/apps/traefik/traefik.toml'} - {src: 'traefik.yml', dest: '/home/josiah/apps/test/traefik.yml'}
- {src: 'traefik.toml', dest: '/home/josiah/apps/test/traefik.toml'}
- name: Deploy awful stack - name: Deploy awful stack
docker_stack: docker_stack:
state: present state: present
name: test name: test
compose: compose:
- /home/josiah/apps/awful/docker-compose.yml - /home/josiah/apps/test/docker-compose.yml

@ -1,9 +1,8 @@
version: '3' version: '3.3'
networks: networks:
gitea: gitea:
external: false external: false
pubnet:
volumes: volumes:
traefik_acme: traefik_acme:
@ -12,35 +11,51 @@ volumes:
services: services:
traefik: traefik:
image: traefik:v2.2 image: traefik:v2.2
networks: environment:
- pubnet DO_AUTH_TOKEN: "{{ DO_AUTH_TOKEN }}"
command: --web --docker --docker.swarmmode --docker.watch --logLevel=DEBUG
ports: ports:
- 80:80 - 80:80/tcp
- 443:443 - 443:443/tcp
- 5000:5000 - 8080:8080/tcp
volumes: volumes:
- traefik_acme:/acme/ - traefik_acme:/acme
- traefik_logs:/var/log/access.log - traefik_logs:/log
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- /home/josiah/apps/traefik/traefik.toml:/traefik.toml - /home/josiah/apps/test/traefik.toml:/etc/traefik/traefik.toml
deploy: deploy:
mode: global mode: global
placement: placement:
constraints: constraints:
- node.role == manager - node.role == manager
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.awfulAll-traefik-api.rule=Host(`awful-1.awful.club`)&&(PathPrefix(`/api`)||PathPrefix(`/dashboard`)||PathPrefix(`/debug`))"
# Dashboard
- "traefik.http.routers.awfulAll-traefik-api.rule=Host(`awful-1.awful.club`)&&(PathPrefix(`/dashboard`)"
- "traefik.http.routers.awfulAll-traefik-api.service=api@internal" - "traefik.http.routers.awfulAll-traefik-api.service=api@internal"
- "traefik.http.routers.awfulAll-traefik-api.entrypoints=http" - "traefik.http.routers.awfulAll-traefik-api.entryPoint=https"
- "traefik.http.routers.awfulAll-traefik-api.tls.certresolver=awfulAll-resolver"
- "traefik.http.routers.awfulAll-traefik-api.tls=true"
whoami: awfulAll-whoami:
image: containous/whoami:latest image: containous/whoami:latest
networks:
- pubnet
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.awfulAll-whoami.rule=Host(`whoami.awful.club`)" - "traefik.http.routers.awfulAll-whoami.rule=Host(`whoami.awful.club`)"
- "traefik.http.routers.awfulAll-whoami.service=awfulAll-whoami" - "traefik.http.routers.awfulAll-whoami.service=awfulAll-whoami"
- "traefik.http.services.awfulAll-whoami.loadbalancer.server.port=80" - "traefik.http.routers.awfulAll-whoami.entryPoint=https"
- "traefik.http.routers.awfulAll-whoami.tls.certresolver=awfulAll-resolver"
- "traefik.http.routers.awfulAll-whoami.tls=true"
# root-handlers:
# image: nginx:1.18
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.awfulAll-whoami.rule=Host(`whoami.awful.club`)"
# - "traefik.http.routers.awfulAll-whoami.service=awfulAll-whoami"
# - "traefik.http.routers.awfulAll-whoami.entryPoints=https"
# - "traefik.http.routers.awfulAll-whoami.tls.certresolver=awfulAll-resolver"
# # - "traefik.http.services.awfulAll-whoami.loadbalancer.server.port=443"
# volumes:
# - /home/josiah/apps/nginx:/etc/nginx/conf.d

@ -8,6 +8,7 @@ defaultEntryPoints = ["http", "https"]
[api] [api]
dashboard = true dashboard = true
insecure = false
[entryPoints] [entryPoints]
[entryPoints.http] [entryPoints.http]
@ -16,13 +17,17 @@ defaultEntryPoints = ["http", "https"]
address = ":443" address = ":443"
[http.middlewares] [http.middlewares]
[http.middlewares.mediaserver-https-redir.redirectScheme] [http.middlewares.awfulAll-https-redir.redirectScheme]
scheme = "https" scheme = "https"
permanent = true permanent = true
[certificatesResolvers.mediaserver-resolver.acme] [certificatesResolvers.awfulAll-resolver.acme]
storage = "/acme.json" storage = "/acme/acme.json"
email = "<me@jowj.net>" email = "me@jowj.net"
caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
[certificatesResolvers.awfulAll-resolver.acme.dnsChallenge]
provider = "digitalocean"
[providers.docker] [providers.docker]
@ -31,3 +36,5 @@ defaultEntryPoints = ["http", "https"]
endpoint = "unix:///var/run/docker.sock" endpoint = "unix:///var/run/docker.sock"
watch = true watch = true
exposedbydefault = false exposedbydefault = false

@ -0,0 +1,39 @@
# defaultEntryPoints must be at the top
# because it should not be in any table below
defaultEntryPoints: ["http", "https"]
global:
checkNewVersion: true
sendAnonymousUsage: true
api:
dashboard: true
debug: true
insecure: false
entryPoints:
ssh:
address: ":22"
http:
address: ":80"
https:
address: ":443"
providers:
docker:
watch: true
swarmMode: true
endpoint: "unix:///var/run/docker.sock"
exposedbydefault: false
certificatesResolvers:
letsencrypt:
acme:
email: "me@jowj.net"
storage: "/acme/acme.json"
caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
dnsChallenge:
provider: "digitalocean"
log:
# filePath: "/log/traefik.log"
level: DEBUG
# accessLog:
# filePath: "/log/access.log"
# bufferingSize: 100
Loading…
Cancel
Save