Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

DZGA with Docker

DewGew edited this page Sep 26, 2023 · 20 revisions

Docker

Docker compose is required

Just open a terminal window and execute this command.

cd /home/${USER}
git clone https://github.com/DewGew/Domoticz-Google-Assistant -b master --single-branch
docker-compose -f /home/${USER}/Domoticz-Google-Assistant/docker-compose.yaml up -d

After a few min dzga UI is reachable.

Start/stop Domoticz-Google-Assistant docker server:

docker-compose -f /home/${USER}/Domoticz-Google-Assistant/docker-compose.yaml start
docker-compose -f /home/${USER}/Domoticz-Google-Assistant/docker-compose.yaml stop

Docker container will read the config files in /home/${USER}/Domoticz-Google-Assistant/config folder

Docker on synology

SSH onto your synology & login as user

cd /volume1/${USER}/
git clone https://github.com/DewGew/Domoticz-Google-Assistant -b master --single-branch

Edit docker-compose.yaml:

sudo nano /volume1/${USER}/Domoticz-Google-Assistant/docker-compose.yaml:

and change this:

- /home/${USER}/Domoticz-Google-Assistant/config:/config

to:

- /volume1/${USER}/Domoticz-Google-Assistant/config:/config

Start Domoticz-Google-Assistant docker server

docker-compose -f /volume1/${USER}/Domoticz-Google-Assistant/docker-compose.yaml up -d

Start/stop Domoticz-Google-Assistant docker server:

docker-compose -f /volume1/${USER}/Domoticz-Google-Assistant/docker-compose.yaml start
docker-compose -f /volume1/${USER}/Domoticz-Google-Assistant/docker-compose.yaml stop

Docker container will read the config files in /volume1/${USER}/Domoticz-Google-Assistant/Config folder

docker-compose.yaml

version: '3'
services:
  dz-googleassistant:
    image: dewgew/domoticz-google-assistant
    container_name: domoticz-google-assistant
    environment:
      - PUID=1010
      - PGID=1010
    ports:
      - 3030:3030
    volumes:
      - /home/${USER}/Domoticz-Google-Assistant/config:/config
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped

General docker-compose.yml for Ansible:

---
- hosts: all
  vars:
    data_directory: "/path/to/dzGA"
    user_id: "1010"
    group_id: "1010"
    
  tasks:
  - name: Create dzGA Directories
    file:
      path: "{{ item }}"
      state: directory
      mode: 0640
      owner: "{{ user_id }}"
      group: "{{ group_id }}"
    with_items:
      - "{{ data_directory }}/config"
    
  - name: dzGA Docker Container
    docker_container:
      name: dzGA
      image: dewgew/domoticz-google-assistant
      pull: true
      volumes:
        - "{{ data_directory }}/config:/dzGA/config:rw"
        - "/etc/timezone:/etc/timezone:ro"
        - "/etc/localtime:/etc/localtime:ro"
      ports:
      - "3030:3030"
      env:
        PUID: "{{ user_id }}"
        PGID: "{{ group_id }}"
      restart_policy: unless-stopped
      memory: 1g