Add Traefik

This commit is contained in:
Imran Remtulla
2025-10-25 05:52:07 -04:00
parent 6c18213990
commit 603bdd12b5

View File

@@ -1,5 +1,39 @@
services:
traefik: # https://github.com/traefik/traefik
image: traefik:latest
container_name: traefik
command:
- "--api=true"
- "--api.dashboard=true"
- "--api.insecure=false"
- "--global.sendAnonymousUsage=false"
- "--global.checkNewVersion=true"
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
- "--entryPoints.web=true"
- "--entryPoints.web.address=:80"
- "--entryPoints.web.http.redirections.entryPoint.to=websecure"
- "--entryPoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
- "--entryPoints.websecure=true"
- "--entryPoints.websecure.address=:443"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.imranr.cloud`)" # Add to /etc/hosts
- "traefik.http.routers.api.entryPoints=websecure"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.tls=true"
restart: unless-stopped
networks:
- traefik
filebrowser: # https://github.com/filebrowser/filebrowser
container_name: filebrowser
image: filebrowser/filebrowser
@@ -8,8 +42,22 @@ services:
volumes:
- ./filebrowser_storage:/srv # Create first
- filebrowser_db:/database
ports:
- 8080:80
depends_on:
- traefik
networks:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.filebrowser.rule=Host(`files.imranr.cloud`)" # Add to /etc/hosts
- "traefik.http.routers.filebrowser.entrypoints=websecure"
- "traefik.http.routers.filebrowser.tls=true"
- "traefik.http.services.filebrowser.loadbalancer.server.port=80"
volumes:
filebrowser_db:
networks:
traefik:
ipam:
config:
- subnet: 172.19.0.0/16