Skip to content

Instantly share code, notes, and snippets.

@j18e
Last active January 17, 2023 01:19
Show Gist options
  • Save j18e/cc5b250f71d3031b1778a104798b640c to your computer and use it in GitHub Desktop.
Save j18e/cc5b250f71d3031b1778a104798b640c to your computer and use it in GitHub Desktop.
Unifi controller behind Traefik reverse proxy in Docker
version: '3'
services:
unifi:
restart: always
hostname: unifi
container_name: "unifi"
image: linuxserver/unifi-controller
volumes: ["../data/unifi/:/config"]
environment:
TZ: "America/Seattle"
PUID: "1000"
PGID: "999"
ports:
- "3478:3478/udp"
- "10001:10001/udp"
- "8080:8080"
- "8081:8081"
- "8443:8443"
- "8843:8843"
- "8880:8880"
- "6789:6789"
labels:
- "traefik.enable=true"
- "traefik.protocol=https"
- "traefik.port=8443"
- "traefik.frontend.rule=Host:unifi.example.com"
traefik:
restart: always
image: "traefik:alpine"
command:
- --configfile=/config/traefik.toml
ports:
- "80:80"
- "443:443"
volumes:
- "./traefik.toml:/config/traefik.toml:ro"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./logs/traefik:/var/log/traefik"
- "./data/traefik:/data"
defaultEntryPoints = ["http", "https"]
logLevel = "INFO"
insecureSkipVerify = true
[api]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[traefikLog]
[accessLog]
format = "json"
filePath = "/var/log/traefik/access.jsonlog"
[docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
exposedByDefault = false
[acme]
email = "user@example.com"
storage = "/data/acme.json"
entrypoint = "httpsExternal"
acmeLogging = true
onHostRule = true
[acme.httpChallenge]
entryPoint = "httpExternal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment