diff --git a/traefik/docker-compose.yml b/traefik/docker-compose.yml new file mode 100644 index 0000000..9f60025 --- /dev/null +++ b/traefik/docker-compose.yml @@ -0,0 +1,61 @@ +name: traefik + +services: + + traefik: + image: "traefik:latest" + container_name: "traefik" + restart: always + environment: + - OVH_ENDPOINT=${OVH_ENDPOINT} + - OVH_APPLICATION_KEY=${OVH_APPLICATION_KEY} + - OVH_APPLICATION_SECRET=${OVH_APPLICATION_SECRET} + - OVH_CONSUMER_KEY=${OVH_CONSUMER_KEY} + ports: + - "80:80" + - "443:443" + - "3478:3478/udp" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "./traefik-conf.yml:/traefik.yml:ro" + - "./acme.json:/acme.json" + - "./letsencrypt:/letsencrypt" + labels: + - "traefik.enable=true" + - "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_URL}`)" + - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)" + - "traefik.http.routers.http-catchall.entrypoints=web" + - "traefik.http.routers.http-catchall.middlewares=redirect-to-https" + - "traefik.http.routers.traefik-dashboard.rule=Host(`${DASHBOARD_URL}`)" + - "traefik.http.routers.traefik-dashboard.service=api@internal" + - "traefik.http.routers.traefik-dashboard.entrypoints=websecure" + - "traefik.http.routers.traefik-dashboard.tls=true" + - "traefik.http.routers.traefik-dashboard.tls.certresolver=letsencrypt" + - "traefik.http.routers.traefik-dashboard.middlewares=auth" + - "traefik.http.middlewares.auth.basicauth.users=${AUTH_USER}:${AUTH_PASS}" + - homepage.group=Work + - homepage.name=Traefik + - homepage.href= + - homepage.description=Dashboard Traefik + - homepage.icon=traefik.png + + networks: + - web + + + whoami: + image: containous/whoami + container_name: whoami + labels: + - "traefik.enable=true" + - "traefik.http.routers.whoami.rule=Host(`${TRAEFIK_URL}`)" + - "traefik.http.routers.whoami.entrypoints=websecure" + - "traefik.http.routers.whoami.tls=true" + - "traefik.http.routers.whoami.tls.certresolver=letsencrypt" + networks: + - web + +networks: + web: + external: true \ No newline at end of file