feat: initial commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-01-15 21:32:00 +01:00
commit e53a7da36c
40 changed files with 516 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
# {{ ansible_managed }}
[Unit]
Description=Traefik
Wants=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/local/bin/docker-compose -f "{{ traefik_docker_compose_directory }}/docker-compose.yml" up
ExecStop=/usr/local/bin/docker-compose -f "{{ traefik_docker_compose_directory }}/docker-compose.yml" down
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,27 @@
---
# {{ ansible_managed }}
version: '3.2'
services:
traefik:
image: traefik:{{ traefik_version }}
restart: always
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "443:443" # The HTTPS ports
{% if traefik_dashboard_enabled %}
- "8080:8080" # Dashboard port
{% endif %}
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
- {{ traefik_docker_compose_directory }}/traefik.toml:/traefik.toml
- {{ traefik_docker_compose_directory }}/acme.json:/acme.json
labels:
- traefik.enable=true
- traefik.docker.network=traefik_network
networks:
- traefik_network
networks:
traefik_network:
external: true

View File

@@ -0,0 +1,43 @@
# {{ ansible_managed }}
###Traefik.toml###
logLevel = "{{ traefik_docker_log_level }}"
defaultEntryPoints = ["http","https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
{% if not traefik_acme_enabled %}
[[entryPoints.https.tls.certificate]]
certFile = "/certs/local-cert.pem"
keyFile = "/certs/local-key.pem"
{% endif %}
{% if traefik_dashboard_enabled %}
[api]
# With this you enable the web UI
insecure = true
dashboard = true
{% endif %}
{% if traefik_acme_enabled %}
[acme]
email = "etienne.besson@gmail.com"
storage = "acme.json"
onHostRule = true
entryPoint = "https"
[acme.tlsChallenge]
{% endif %}
# Enable Docker configuration backend
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "{{ traefik_docker_domain }}"
watch = true
exposedByDefault = false