diff --git a/docker-compose.yml b/docker-compose.yml index 4af2862..a4e4e75 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:?} @@ -11,13 +19,21 @@ services: MONGO_DBNAME: ${MONGO_DBNAME:-unifi} MONGO_USER: ${MONGO_USER:-unifi} MONGO_PASS: ${MONGO_PASS:?} + networks: + - traefik 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.server.scheme: https + traefik.http.services.unifi.loadbalancer.serverstransport.insecureskipverify: "true" + traefik.docker.network: traefik + traefik.enable: true db: image: ${MONGO_IMAGE:-mongo}:${MONGO_VERSION:?} @@ -25,7 +41,3 @@ services: volumes: - db:/data/db - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro - -volumes: - db: - app: