From 6d4848c1689d9122dca1b1573b7596daf0b40a99 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Mon, 30 Dec 2024 13:24:21 -0500 Subject: [PATCH] Add Traefik proxy support and cleanup ports --- docker-compose.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4af2862..8bb31d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,11 @@ +volumes: + db: + app: + +networks: + traefik: + external: true + services: app: image: ${UNIFI_IMAGE:-linuxserver/unifi-network-application}:${UNIFI_VERSION:?} @@ -14,10 +22,17 @@ services: volumes: - app:/config ports: - - 8443:8443 - 3478:3478/udp - 10001:10001/udp - - 8080:8080 + labels: + traefik.http.routers.unifi.rule: Host(`${DOMAIN:-unifi.local.krislamo.org}`) + traefik.http.routers.unifi.entrypoints: ${ENTRYPOINT:-web} + traefik.http.services.unifi.loadbalancer.server.port: 8443 + traefik.http.services.unifi.loadbalancer.serverstransport: ignorecert + traefik.http.services.unifi.loadbalancer.server.scheme: https + traefik.http.serversTransports.ignorecert.insecureSkipVerify: "true" + traefik.docker.network: traefik + traefik.enable: true db: image: ${MONGO_IMAGE:-mongo}:${MONGO_VERSION:?} @@ -25,7 +40,3 @@ services: volumes: - db:/data/db - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro - -volumes: - db: - app: