Skip to content

Instantly share code, notes, and snippets.

@quells
Created September 18, 2020 15:46
Show Gist options
  • Save quells/d273dc12a0b7d163254270224314f3f8 to your computer and use it in GitHub Desktop.
Save quells/d273dc12a0b7d163254270224314f3f8 to your computer and use it in GitHub Desktop.
Run UniFi Controller in a Docker container
DATA = $(shell pwd)/data
LOGS = $(shell pwd)/logs
TZ = America/Los_Angeles
NAME = unifi
IMAGE = jacobalberty/unifi:stable
.PHONY: run
run:
docker run -d --rm --init \
-p 8080:8080 \
-p 8443:8443 \
-p 3478:3478/udp \
-p 10001:10001/udp \
-e TZ=$(TZ) \
-e RUNAS_UID0=false \
--volume=$(DATA):/unifi/data \
--volume=$(LOGS):/unifi/log \
--name $(NAME) \
$(IMAGE)
.PHONY: stop
stop:
docker container stop $(NAME)
.PHONY: logs
logs:
docker logs -f $(NAME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment