refactor: add https and acme to traefik

This commit is contained in:
2023-03-29 22:19:37 -07:00
parent ed426593d4
commit c3f6bd2ea9
9 changed files with 65 additions and 24 deletions

View File

@@ -0,0 +1 @@
CF_DNS_API_TOKEN={{ cloudflare_api_token }}

View File

@@ -1,3 +1,5 @@
{% from "contrib/compose_helpers.j2" import traefik_labels with context %}
{##}
version: "3.7"
networks:
@@ -13,12 +15,11 @@ services:
image: traefik:v2.9
container_name: traefik
labels:
- traefik.enable=true
- traefik.http.routers.traefik.rule=Host(`traefik.{{ domain }}`)
- traefik.http.services.traefik.loadbalancer.server.port=8080
- {{ traefik_labels("traefik", service="api@internal") | indent(6) }}
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "8080:8080"
env_file:
- .env.traefik
@@ -29,5 +30,6 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/traefik.yml:ro
- {{ base_volume_path }}/traefik/rules:/rules:ro
- {{ base_volume_path }}/traefik/logs:/logs
- ./rules:/rules:ro
- {{ base_volume_path }}/traefik/acme:/acme

View File

@@ -14,6 +14,22 @@ entryPoints:
forwardedHeaders:
trustedIPs:
- "172.16.0.0/12"
websecure:
address: ":443"
certificatesResolvers:
letsencrypt:
acme:
email: {{ acme_email }}
storage: "/acme/acme.json"
keyType: "EC384"
dnsChallenge:
provider: "cloudflare"
delayBeforeCheck: 10
resolvers:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
providers:
docker:

View File

@@ -0,0 +1,10 @@
$ANSIBLE_VAULT;1.2;AES256;alpina
35326636356536326332383464373937366130613966663736396135306131353463353334336364
6438346563313332313835326634383063323739643165660a353431336266353239323863363637
34383565626131353530313531663034386530373133653463353063626466613436366235393638
6432363033343336620a336265666362663861393762316137356635363834326566623462373531
62313233306533336331383964346536303362383639633337386664646535313133633164316530
62623535633062656330363931353665396431376233613936626232313264376634646237303236
38396234323931613539393034396461383564363064356635343730633233366666313434646439
34633739333964383865396133313936363166643464613132633031663065623664616365656164
62643035623261623435336462643864396135323139336662363865306661356534