pydio / cells

Future-proof content collaboration platform
https://pydio.com
GNU Affero General Public License v3.0
1.77k stars 172 forks source link

docker image does not recognise timezone appropriately #562

Open instantdreams opened 4 months ago

instantdreams commented 4 months ago

📝 Describe the bug Date on host reports according to timezone. Date on cells container reports in UTC. Date on database container reports according to timezone.

⚙️ How-to Reproduce

Steps to reproduce the behavior:

  1. Run pydio cells in container, passing "TZ" environment variable and "localtime" and "timezone" volumes
  2. Run the following commands:
$ docker exec pydio-cells date
Tue Apr 16 14:42:38 America 2024
$ docker exec pydio-cells cat /etc/timezone
America/Edmonton

$ docker exec pydio-db date
Tue Apr 16 08:42:56 MDT 2024
$ docker exec pydio-db cat /etc/timezone
America/Edmonton

🩺 Environment / Setup

Complete the following information:

Server Versions:

Client used for testing:

Additional context:

bsinou commented 4 months ago

Hi. Could you please precise what image you are using ? It is not the official image from the Docker's hub: pydio/cells:latest, is it ?

instantdreams commented 4 months ago

Here's my compose.yaml file:

services:
  pydio:
    image: pydio/cells:latest
    container_name: pydio-cells
    hostname: files
    domainname: example.com
    ports:
      - "8808:8080" # web ui
    environment:
      - TZ=America/Edmonton
      - CELLS_INSTALL_YAML=/pydio/config/install-conf.yml
      - CELLS_BIND=0.0.0.0:8080
      - CELLS_SITE_BIND=0.0.0.0:8080
      - CELLS_EXTERNAL=https://files.example.com
      - CELLS_SITE_EXTERNAL=https://files.example.com
      - CELLS_NO_TLS=1
      - CELLS_LOG=info
      - CELLS_LOG_LEVEL=production
      - CELLS_DEFAULT_DS_STRUCT=true
    volumes:
      - /srv/pydio/config/install-conf.yml:/pydio/config/install-conf.yml:ro
      - /srv/pydio/cells:/var/cells
      - /media/storage/cells/:/var/cells/data
      - /media:/media
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
  pydio-db:
    image: mysql:latest
    container_name: pydio-db
    hostname: pydio-db
    domainname: example.com
    command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci]
    ports:
      - "3306:3306" # mysql
    environment:
      - TZ=America/Edmonton
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    volumes:
      - /srv/pydio/mysql:/var/lib/mysql
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped

Here's me trying to pull the latest image to confirm that it is up to date:

$ docker pull pydio/cells:latest
latest: Pulling from pydio/cells
Digest: sha256:5588c806d566ee1d83a1029015aff07fd9720363286127718f495317e1c50f80
Status: Image is up to date for pydio/cells:latest
docker.io/pydio/cells:latest

So yup, pydio/cells:latest is correct.