Newer
Older

Arthur Le Bars
committed
version: '3.7'
services:
traefik:
image: traefik:2.1.6
command:
- "--api"
- "--api.dashboard"
- "--log.level=DEBUG"
- "--providers.docker"
- "--providers.docker.swarmMode=true"

Loraine Gueguen
committed
- "--providers.docker.network=traefikbig"

Arthur Le Bars
committed
- "--entryPoints.web.address=:80"

Loraine Gueguen
committed
- "--entryPoints.web.forwardedHeaders.trustedIPs={{ proxy_ip }}" # The ips of our upstream proxies

Arthur Le Bars
committed
- "--entryPoints.webs.address=:443"

Loraine Gueguen
committed
- "--entryPoints.webs.forwardedHeaders.trustedIPs={{ proxy_ip }}" # The ips of our upstream proxies

Arthur Le Bars
committed
ports:
- {{ http_port }}:80

Arthur Le Bars
committed
- {{ https_port }}:443

Arthur Le Bars
committed
networks:
- traefikbig
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints:
- node.role == manager
labels:

Loraine Gueguen
committed
- "traefik.http.routers.traefik-api.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`) || PathPrefix(`/traefik`)"
{% if https_port is defined %}
- "traefik.http.routers.traefik-api.tls=true"
- "traefik.http.routers.traefik-api.entryPoints=webs"
{% else %}

Loraine Gueguen
committed
- "traefik.http.routers.traefik-api.entryPoints=web"

Arthur Le Bars
committed
- "traefik.http.routers.traefik-api.service=api@internal"
- "traefik.http.middlewares.traefik-strip.stripprefix.prefixes=/traefik"

Loraine Gueguen
committed
- "traefik.http.middlewares.traefik-auth.forwardauth.address=http://authelia:9091/api/verify?rd=https://{{ authentication_domain_name }}/"

Arthur Le Bars
committed
- "traefik.http.middlewares.traefik-auth.forwardauth.trustForwardHeader=true"

Loraine Gueguen
committed
{% if https_port is defined %}
- "traefik.http.routers.traefik-api.middlewares=traefik-auth,traefik-strip"
{% else %}
- "traefik.http.routers.traefik-api.middlewares=traefik-strip"
{% endif %}

Arthur Le Bars
committed
# Dummy service for Swarm port detection. The port can be any valid integer value.
- "traefik.http.services.traefik-svc.loadbalancer.server.port=9999"
# Some generally useful middlewares for organisms hosting

Loraine Gueguen
committed
- "traefik.http.middlewares.sp-auth.forwardauth.address=http://authelia:9091/api/verify?rd=https://{{ authentication_domain_name }}/"

Arthur Le Bars
committed
- "traefik.http.middlewares.sp-auth.forwardauth.trustForwardHeader=true"
- "traefik.http.middlewares.sp-auth.forwardauth.authResponseHeaders=Remote-User,Remote-Groups"
{% if https_port is defined %}
- "traefik.http.middlewares.sp-trailslash.redirectregex.regex=^(https?://[^/]+/sp/[^/]+)$$"
{% else %}

Loraine Gueguen
committed
- "traefik.http.middlewares.sp-trailslash.redirectregex.regex=^(http?://[^/]+/sp/[^/]+)$$"

Arthur Le Bars
committed
- "traefik.http.middlewares.sp-trailslash.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.sp-trailslash.redirectregex.permanent=true"
{% if https_port is defined %}
- "traefik.http.middlewares.sp-app-trailslash.redirectregex.regex=^(https?://[^/]+/sp/[^/]+/[^/]+)$$"
{% else %}

Loraine Gueguen
committed
- "traefik.http.middlewares.sp-app-trailslash.redirectregex.regex=^(http?://[^/]+/sp/[^/]+/[^/]+)$$"

Arthur Le Bars
committed
- "traefik.http.middlewares.sp-app-trailslash.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.sp-app-trailslash.redirectregex.permanent=true"
- "traefik.http.middlewares.sp-prefix.stripprefixregex.regex=/sp/[^/]+"
- "traefik.http.middlewares.sp-app-prefix.stripprefixregex.regex=/sp/[^/]+/[^/]+"
- "traefik.http.middlewares.tripal-addprefix.addprefix.prefix=/tripal"
- "traefik.http.middlewares.sp-big-req.buffering.maxRequestBodyBytes=50000000"
- "traefik.http.middlewares.sp-huge-req.buffering.maxRequestBodyBytes=2000000000"
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s

Arthur Le Bars
committed
authelia:
image: authelia/authelia:4.12.0
networks:
- traefikbig
depends_on:
- authelia-redis
- authelia-db
volumes:
- ./authelia/:/etc/authelia/:ro

Loraine Gueguen
committed
{% if authelia_secrets_env_path is defined %}
env_file:

Loraine Gueguen
committed
- {{authelia_secrets_env_path}}

Loraine Gueguen
committed
{% endif %}

Arthur Le Bars
committed
deploy:
labels:

Arthur Le Bars
committed
- "traefik.http.routers.authelia.rule=Host(`{{ authentication_domain_name }}`)"

Arthur Le Bars
committed
- "traefik.http.services.authelia.loadbalancer.server.port=9091"
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
authelia-redis:
image: redis:5.0.7-alpine
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ./authelia-redis/:/data/
networks:
- traefikbig
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
authelia-db:
image: postgres:12.2-alpine
environment:

Loraine Gueguen
committed
POSTGRES_PASSWORD: {{ authelia_db_postgres_password }}

Arthur Le Bars
committed
volumes:
- ./docker_data/authelia_db/:/var/lib/postgresql/data/
networks:
- traefikbig
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s

Arthur Le Bars
committed
networks:
traefikbig:
driver: overlay
name: traefikbig
ipam:
config:

Loraine Gueguen
committed
- subnet: 10.50.0.0/16