Last active
January 28, 2021 19:08
Working traefik + zoneminder docker setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
traefik: | |
image: traefik | |
restart: always | |
ports: | |
- "80:80" #http | |
- "443:443" #https | |
- "8080:8080" #web ui | |
networks: | |
- web | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /opt/traefik/traefik.toml:/etc/traefik/traefik.toml | |
- /opt/traefik/acme.json:/etc/traefik/acme.json | |
container_name: traefik | |
networks: | |
web: | |
external: | |
name: web |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debug = false | |
logLevel = "DEBUG" | |
defaultEntryPoints = ["https","http"] | |
[entryPoints] | |
[entryPoints.http] | |
address = ":80" | |
[entryPoints.http.redirect] | |
entryPoint = "https" | |
[entryPoints.https] | |
address = ":443" | |
[entryPoints.https.tls] | |
[retry] | |
[api] | |
address = ":8080" | |
[docker] | |
endpoint="unix:///var/run/docker.sock" | |
domain = "home.example.com" | |
watch=true | |
exposedByDefault=false | |
[acme] | |
email = "[email protected]" | |
storageFile = "/etc/traefik/acme.json" | |
entryPoint = "https" | |
acmeLogging = true | |
onDemand = false | |
OnHostRule = true | |
[acme.httpChallenge] | |
entryPoint = "http" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.2' | |
services: | |
db: | |
image: mysql/mysql-server:5.7 | |
volumes: | |
- /var/lib/docker/volumes/zoneminder/mysql/data:/var/lib/mysql | |
- /var/lib/docker/volumes/zoneminder/mysql/conf:/etc/mysql:ro | |
environment: | |
- TZ=America/Chicago | |
- MYSQL_USER=zmuser | |
- MYSQL_PASSWORD=zmpass | |
- MYSQL_DATABASE=zm | |
- MYSQL_ROOT_PASSWORD=mysqlpsswd | |
- MYSQL_ROOT_HOST=% | |
restart: always | |
web: | |
image: quantumobject/docker-zoneminder | |
networks: | |
- web | |
ports: | |
- "8081:80" #So I can access it on internal network on a shared host | |
volumes: | |
- /var/empty | |
- /var/lib/docker/volumes/zoneminder/backups:/var/backups | |
- /var/lib/docker/volumes/zoneminder/cache:/var/cache/zoneminder | |
- type: tmpfs | |
target: /dev/shm | |
environment: | |
- TZ=America/Chicago | |
# - VIRTUAL_HOST=zm.localhost, stream0.localhost | |
# - SERVICE_PORTS="8081" | |
# - ZM_SERVER_HOST=node.0 | |
- ZM_DB_HOST=db | |
restart: always | |
labels: | |
- "traefik.enable=true" | |
- "traefik.frontend.rule=Host:home.example.com; PathPrefix:/zm" | |
- "traefik.frontend.redirect.entryPoint=https" | |
- "traefik.docker.network=web" | |
- "traefik.port=80" | |
depends_on: | |
- db | |
networks: | |
web: | |
external: | |
name: web |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment