version: "3.5" networks: habnet: name: habnet driver: overlay attachable: true configs: backup_config: file: ./volumerize/backup_config.json sftp_config: file: ./ssh/sshd_config sftp_users: file: ./ssh/sftp_users.conf sftp_key_ed: file: ./ssh/ssh_host_ed25519_key sftp_id_pub: file: ./ssh/id_rsa.pub sftp_id_key: file: ./ssh/id_rsa sftp_known_hosts: file: ./ssh/known_hosts traefik_config: file: ./traefik/traefik.toml traefik_users: file: ./traefik/traefik_users nodered_settings: file: ./nodered/nodered_settings.js nodered_package: file: ./nodered/nodered_package.json mosquitto_passwords: file: ./mosquitto/mosquitto_passwords mosquitto_settings: file: ./mosquitto/mosquitto.conf postgres_user: file: ./postgres/user postgres_passwd: file: ./postgres/passwd landing_logo: file: ./pb-framr/logo.svg landing_pages: file: ./pb-framr/pages.json filebrowser: file: ./filebrowser/filebrowser.json volumes: openhab_addons: openhab_conf: openhab_userdata: nodered_data: mosquitto_data: influxdb_data: postgres_data: backup_data: backup_cache: services: backup: image: blacklabelops/volumerize volumes: - "openhab_userdata:/source/openhab_userdata" - "openhab_conf:/source/openhab_conf" - "openhab_addons:/source/openhab_addons" - "nodered_data:/source/nodered_data" - "influxdb_data:/source/influxdb_data" - "backup_cache:/volumerize-cache" - "backup_data:/backup" configs: - source: backup_config target: /backup_config.json - source: sftp_id_key target: /root/.ssh/id_rsa mode: 0400 - source: sftp_known_hosts target: /root/.ssh/known_hosts mode: 0400 environment: - VOLUMERIZE_SOURCE=/source - VOLUMERIZE_TARGET='multi:///backup_config.json?mode=mirror&onfail=abort' - VOLUMERIZE_DUPLICITY_OPTIONS=--ssh-options "-oStrictHostKeyChecking=no" networks: - habnet deploy: placement: constraints: - node.labels.building == X sftp: image: "atmoz/sftp" volumes: - "openhab_userdata:/home/ohadmin/openhab_userdata" - "openhab_conf:/home/ohadmin/openhab_conf" - "nodered_data:/home/ohadmin/nodered_data" - "backup_data:/home/ohadmin/backup_data" configs: - source: sftp_config target: /etc/ssh/sshd_config - source: sftp_users target: /etc/sftp/users.conf - source: sftp_key_ed target: /etc/ssh/ssh_host_ed25519_key mode: 0400 - source: sftp_id_key target: /home/ohadmin/.ssh/id_rsa uid: '9001' mode: 0400 - source: sftp_id_pub target: /home/ohadmin/.ssh/keys/sync.pub networks: - habnet deploy: placement: constraints: - node.labels.building == X openhab: image: "openhab/openhab:2.4.0-amd64-debian" volumes: - "/etc/localtime:/etc/localtime:ro" - "/etc/timezone:/etc/timezone:ro" - "openhab_addons:/openhab/addons" - "openhab_conf:/openhab/conf" - "openhab_userdata:/openhab/userdata" environment: OPENHAB_HTTP_PORT: "8181" OPENHAB_HTTPS_PORT: "8443" EXTRA_JAVA_OPTS: '-Dgnu.io.rxtx.SerialPorts=/dev/zwave_stick' networks: - habnet deploy: labels: - "traefik.docker.network=habnet" - "traefik.port=8181" placement: constraints: - node.labels.building == X nodered: image: "nodered/node-red-docker" volumes: - "nodered_data:/data" networks: - habnet configs: - source: nodered_package target: /data/package.json - source: nodered_settings target: /data/settings.js deploy: labels: - "traefik.port=1880" - "traefik.docker.network=habnet" placement: constraints: - node.labels.building == X mqtt: image: "eclipse-mosquitto" volumes: - "mosquitto_data:/mosquitto/data" ports: configs: - source: mosquitto_passwords target: /mosquitto/config/passwd - source: mosquitto_settings target: /mosquitto/config/mosquitto.conf networks: - habnet deploy: placement: constraints: - node.labels.building == X db: image: "influxdb" volumes: - "influxdb_data:/var/lib/influxdb" configs: - source: influx_init target: /init-influxdb.sh mode: 0555 - source: influx_user target: /run/secrets/influx_user environment: INFLUXDB_HTTP_AUTH_ENABLED: "true" INFLUXDB_DB: "openhab" INFLUXDB_ADMIN_USER: "ohadmin" INFLUXDB_ADMIN_PASSWORD: "ohadmin" INFLUXDB_USER: "ohadmin" INFLUXDB_USER_PASSWORD: "ohtest" networks: - habnet deploy: placement: constraints: - node.labels.building == X postgres: image: "postgres" volumes: - "postgres_data:/var/lib/postgresql/data/pgdata" configs: - source: postgres_user target: /run/secrets/postgres_user - source: postgres_passwd target: /run/secrets/postgres_passwd environment: PGDATA: "/var/lib/postgresql/data/pgdata" POSTGRES_USER_FILE: "/run/secrets/postgres_user" POSTGRES_PASSWORD_FILE: "/run/secrets/postgres_passwd" POSTGRES_DB: "openhab" networks: - habnet deploy: placement: constraints: - node.labels.building == X proxy: image: "traefik" command: --api --docker --docker.swarmMode --logLevel="DEBUG" volumes: - "/var/run/docker.sock:/var/run/docker.sock" ports: - "8080:8080" - "80:80" networks: - habnet configs: - source: traefik_config target: /etc/traefik/traefik.toml - source: traefik_users target: /etc/traefik/traefik_users deploy: mode: global placement: constraints: - node.role == manager files: image: filebrowser/filebrowser volumes: - openhab_conf:/srv/openHAB - nodered_data:/srv/Node-RED configs: - source: filebrowser target: /.filebrowser.json networks: - habnet deploy: labels: - "traefik.port=80" - "traefik.docker.network=habnet" placement: constraints: - node.labels.building == X zwave_oh: image: docker command: "docker run --rm --name device_oh --network habnet -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v openhab_zwave_conf:/openhab/conf -v openhab_zwave_userdata:/openhab/userdata -p 9898:8080 openhab/openhab:2.4.0" volumes: - "/var/run/docker.sock:/var/run/docker.sock" networks: - habnet deploy: placement: constraints: - node.labels.device == zwave