mirror of
https://github.com/librenms/docker.git
synced 2026-01-23 10:15:22 +00:00
167 lines
3.9 KiB
YAML
167 lines
3.9 KiB
YAML
version: "3.2"
|
|
|
|
services:
|
|
traefik:
|
|
image: traefik:1.6-alpine
|
|
command:
|
|
- "--logLevel=INFO"
|
|
- "--defaultentrypoints=http,https"
|
|
- "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
|
|
- "--entryPoints=Name:https Address::443 TLS"
|
|
- "--docker"
|
|
- "--docker.exposedbydefault=false"
|
|
- "--docker.domain=example.com"
|
|
- "--acme=true"
|
|
- "--acme.acmelogging=true"
|
|
- "--acme.email=webmaster@example.com"
|
|
- "--acme.storage=acme.json"
|
|
- "--acme.entryPoint=https"
|
|
- "--acme.onhostrule=true"
|
|
- "--acme.httpchallenge=true"
|
|
- "--acme.httpchallenge.entrypoint=http"
|
|
ports:
|
|
- target: 80
|
|
published: 80
|
|
protocol: tcp
|
|
mode: host
|
|
- target: 443
|
|
published: 443
|
|
protocol: tcp
|
|
mode: host
|
|
volumes:
|
|
- "./acme.json:/acme.json"
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
|
restart: always
|
|
|
|
db:
|
|
image: mariadb:10.2
|
|
command:
|
|
- "mysqld"
|
|
- "--sql-mode="
|
|
- "--innodb-file-per-table=1"
|
|
- "--lower-case-table-names=0"
|
|
volumes:
|
|
- "./db:/var/lib/mysql"
|
|
environment:
|
|
- "TZ=${TZ}"
|
|
- "MYSQL_ALLOW_EMPTY_PASSWORD=yes"
|
|
- "MYSQL_DATABASE=${MYSQL_DATABASE}"
|
|
- "MYSQL_USER=${MYSQL_USER}"
|
|
- "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
|
|
restart: always
|
|
|
|
memcached:
|
|
image: memcached:alpine
|
|
environment:
|
|
- "TZ=${TZ}"
|
|
restart: always
|
|
|
|
rrdcached:
|
|
image: crazymax/rrdcached
|
|
volumes:
|
|
- "./librenms/rrd:/data/db"
|
|
- "./rrd-journal:/data/journal"
|
|
environment:
|
|
- "TZ=${TZ}"
|
|
- "PUID=${PUID}"
|
|
- "PGID=${PGID}"
|
|
- "LOG_LEVEL=LOG_INFO"
|
|
- "WRITE_TIMEOUT=1800"
|
|
- "WRITE_JITTER=1800"
|
|
- "WRITE_THREADS=4"
|
|
- "FLUSH_DEAD_DATA_INTERVAL=3600"
|
|
restart: always
|
|
|
|
smtp:
|
|
image: juanluisbaptiste/postfix
|
|
volumes:
|
|
- "/etc/localtime:/etc/localtime:ro"
|
|
environment:
|
|
- "SERVER_HOSTNAME=librenms.example.com"
|
|
- "SMTP_SERVER=${SMTP_SERVER}"
|
|
- "SMTP_USERNAME=${SMTP_USERNAME}"
|
|
- "SMTP_PASSWORD=${SMTP_PASSWORD}"
|
|
restart: always
|
|
|
|
app:
|
|
image: librenms/librenms:latest
|
|
domainname: example.com
|
|
hostname: librenms
|
|
depends_on:
|
|
- db
|
|
- memcached
|
|
- rrdcached
|
|
- smtp
|
|
volumes:
|
|
- "./librenms:/data"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.backend=librenms"
|
|
- "traefik.port=80"
|
|
- "traefik.frontend.rule=Host:librenms.example.com"
|
|
environment:
|
|
- "TZ=${TZ}"
|
|
- "PUID=${PUID}"
|
|
- "PGID=${PGID}"
|
|
- "DB_HOST=db"
|
|
- "DB_NAME=${MYSQL_DATABASE}"
|
|
- "DB_USER=${MYSQL_USER}"
|
|
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
|
- "DB_TIMEOUT=30"
|
|
env_file:
|
|
- "./librenms.env"
|
|
restart: always
|
|
|
|
cron:
|
|
image: librenms/librenms:latest
|
|
domainname: example.com
|
|
hostname: librenms
|
|
command:
|
|
- "/usr/local/bin/cron"
|
|
depends_on:
|
|
- app
|
|
volumes:
|
|
- "./librenms:/data"
|
|
environment:
|
|
- "TZ=${TZ}"
|
|
- "PUID=${PUID}"
|
|
- "PGID=${PGID}"
|
|
- "DB_HOST=db"
|
|
- "DB_NAME=${MYSQL_DATABASE}"
|
|
- "DB_USER=${MYSQL_USER}"
|
|
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
|
- "DB_TIMEOUT=30"
|
|
env_file:
|
|
- "./librenms.env"
|
|
restart: always
|
|
|
|
syslog-ng:
|
|
image: librenms/librenms:latest
|
|
domainname: example.com
|
|
hostname: librenms
|
|
command:
|
|
- "/usr/sbin/syslog-ng"
|
|
- "-F"
|
|
depends_on:
|
|
- app
|
|
ports:
|
|
- target: 514
|
|
published: 514
|
|
protocol: tcp
|
|
- target: 514
|
|
published: 514
|
|
protocol: udp
|
|
volumes:
|
|
- "./librenms:/data"
|
|
environment:
|
|
- "TZ=${TZ}"
|
|
- "PUID=${PUID}"
|
|
- "PGID=${PGID}"
|
|
- "DB_HOST=db"
|
|
- "DB_NAME=${MYSQL_DATABASE}"
|
|
- "DB_USER=${MYSQL_USER}"
|
|
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
|
- "DB_TIMEOUT=30"
|
|
env_file:
|
|
- "./librenms.env"
|
|
restart: always
|