Page 1 of 1

help with dashticz docker

Posted: Tuesday 19 October 2021 17:01
by pvklink
I have all my software running with docker containers(10) with one docker-compose...
But with the last releases of dashticz i cant get this working anymore for dashticz..

So i remove the docker stuff for apache, php and dashticz and did this part the old way:
sudo apt-get update -y
sudo apt-get install apache2 php php-xml php-curl libapache2-mod-php
sudo chmod 777 $homevolumes/dashticz
sudo ln -s $homevolumes/dashticz/ /var/www/html
sudo systemctl restart apache2

The above config works with my general dashticz volume (git) on /home/pi/pvkmenu/volumes/dashticz...
All the other docker stuff works great with a large docker-compose file and volumes!

I like to have apache and php also with docker in the above compose structure and remove the old manual apache and php install on the rpi!
So i took a fragment of my compose file (below) and dockerfiles. This setup works for domoticz and dashticz gives an error.
Thats strange because the dashticz volume is the same git download and adjustments i used with the described old way...

QUESTION: what am i doing wrong with my compose part/dockerfile part
Because the volume part must be ok, as it is working with the old non-docker setip

I start the website with
http://192.168.20.38:8084/index.html and get a dashticz ERROR

docker-compose file

Code: Select all

version: '3.6'

services:

  domoticz:
    container_name: domoticz
    build: 
      context: /home/pi/pvkmenu/services/domoticz/.
    ports:
    - "82:8080"
    - "444:443"
    depends_on:
      - mosquitto  
      - '/dev/ttyUSB0:/dev/ttyUSB0'
      - '/dev/ttyUSB1:/dev/ttyUSB1'
      - '/dev/ttyACM0:/dev/ttyACM0'
    volumes:
    - "/home/pi/pvkmenu/volumes/domoticz/data:/opt/domoticz/userdata"
    - "/var/run/docker.sock:/var/run/docker.sock"
    restart: unless-stopped
    network_mode: bridge
    environment:
    - PUID=1000
    - PGID=1000
    - LOG_PATH=/opt/domoticz/userdata/domoticz.log

  dashticz:
    container_name: dashticz

    build: 
      context: /home/pi/pvkmenu/services/dashticz/.

    restart: always
    depends_on:
      - domoticz
    ports:
      - "8084:80"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - type: bind
        source: /home/pi/pvkmenu/volumes/dashticz/
        target: /var/www/html/
dockerfile dashticz( i took from the git pull folder)
# Dockerfile for Dashticz
# See http://nelkinda.com/blog/apache-php-in-docker/

FROM php:7.4-apache
ARG tz="Europe/Amsterdam"

RUN printf "[PHP]\ndate.timezone = $tz\n" > /usr/local/etc/php/conf.d/tzone.ini && \
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#RUN printf "[PHP]\ndate.timezone = $tz\n" > /usr/local/etc/php/conf.d/tzone.ini
SHELL ["/bin/bash", "-c"]

Re: help with dashticz docker

Posted: Friday 22 October 2021 17:02
by pvklink
I got dashticz in a docker working again for 95%.

Only my calender, news en 112 blocks dont work, they stay empty.
And i have to refresh my cache several times to get the 95% screen shown...
I also tried serveral browsers

It must be related with my dockerfile/image because i use he same data dashticz volume (latest beta git of dashticz) for both the docker based configuration and my other non-docker configuration 1:1 like the manual setup as described in the wiki

95% working set with docker

dockercompose (part of dashticz)

Code: Select all

  dashticz:
    container_name: dashticz
    build: 
      context: /home/pi/pvkmenu/services/dashticz/.
      args:
        MYHUB: "${MYHUB_dashticz}php:7.4-apache"
    restart: always
    depends_on:
      - domoticz
    ports:
      - "8084:80"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - type: bind
        source: /home/pi/pvkmenu/volumes/dashticz/
        target: /var/www/html/

envfile

Code: Select all

MYHUB=docker.io/ 
MYHUB_apache=docker.io/ 
MYHUB_broadlink=docker.io/ 
MYHUB_dashboard=docker.io/ 
MYHUB_dashticz=docker.io/ 
MYHUB_domoticz=docker.io/ 
MYHUB_drupal=docker.io/ 
MYHUB_mosquitto=docker.io/ 
MYHUB_motion=docker.io/ 
MYHUB_motioneye=docker.io/ 
MYHUB_mysql=docker.io/ 
MYHUB_nextpvr=docker.io/ 
MYHUB_nodered=docker.io/ 
MYHUB_phpmyadmin=docker.io/ 
MYHUB_portainer=docker.io/ 
MYHUB_raspiap=docker.io/ 
MYHUB_registry=docker.io/ 
MYHUB_tvheadend=docker.io/ 
MYHUB_unify=docker.io/ 
MYHUB_apachetest=docker.io/ 

dockerfile

Code: Select all

ARG MYHUB
FROM ${MYHUB}

ARG tz="Europe/Amsterdam" 
RUN printf "[PHP]\ndate.timezone = $tz\n" > /usr/local/etc/php/conf.d/tzone.ini && \
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

CMD ["apache2-foreground"]
SHELL ["/bin/bash", "-c"]