samply / blaze

A FHIR® Server with internal, fast CQL Evaluation Engine
https://samply.github.io/blaze
Apache License 2.0
148 stars 18 forks source link

Zeitzone Docker Container Blaze FHIR Server #786

Open NamUKF opened 2 years ago

NamUKF commented 2 years ago

Hi,

ich will gerade testweise einen FHIR Server für mich hochfahren und stelle dabei fest, dass die Zeitzone für den Blaze FHIR Server nicht korrekt übernommen wird.

Im Image wurde tzdata installiert (siehe https://hub.docker.com/layers/eclipse-temurin/library/eclipse-temurin/17-jre/images/sha256-a244fb3160b6db1ca2c36ecf685db5a3777018777b64405573ce1aa4774d80fb?context=explore), weshalb eigentlich das setzen der Umgebungsvariable $TZ=Europe/Berlin nach meinen Verständnis ausreichend sollte, um die Zeitzone für den Container zu setzen.

In den Logs vom Blaze FHIR Server stelle ich leider fest, dass der Timestamp auf UTC+0 gesetzt ist, Also zum Teil wird das Datum im Container übernommen, wenn man das ganze über eine interactive Shell überprüft:

root@diz-sdr2:~# docker exec -u root -it dsf-gecco-test-fhir-server-1 /bin/bash
bash-4.4# date
Thu Aug 11 14:06:24 CEST 2022
bash-4.4# zdump /etc/localtime
/etc/localtime  Thu Aug 11 12:06:36 2022 UTC

Wie es aus diesem Ausschnitt ersichtlich ist, wirkt sich die Umgebungsvariable nicht auf die /etc/localtime vom container aus, was von den Logs wohl verwendet wird.

Hab ich eine Fehlkonfiguration bei mir bzw. habt ihr eine Idee wie ich die Zeitzone für den Container korrekt anpassen kann ?

Docker compose file

version: '3.7'
services:
  fhir-server:
    image: ghcr.io/medizininformatik-initiative/blaze:0.16
    environment:
      TZ: ${TZ:-Europe/Berlin}
      BASE_URL: ${FHIR_SERVER_BASE_URL:-http://fhir-server:8080}
      LOG_LEVEL: ${FHIR_SERVER_LOG_LEVEL:-error}
      JAVA_TOOL_OPTIONS: ${BLAZE_JVM_ARGS:--Xmx4g}
      DB_BLOCK_CACHE_SIZE: ${BLAZE_BLOCK_CACHE_SIZE:-256}
      DB_RESOURCE_CACHE_SIZE: ${BLAZE_DB_RESOURCE_CACHE_SIZE:-2000000}
      DB_RESOURCE_HANDLE_CACHE_SIZE: ${BLAZE_DB_RESOURCE_HANDLE_CACHE_SIZE:-1000000}
      ENFORCE_REFERENTIAL_INTEGRITY: "false"
      #ports:
      #- ${PORT_FHIR_SERVER_LOCALHOST:-127.0.0.1:8081}:8080
    restart: unless-stopped
    volumes:
      - "blaze-data:/app/data"
    networks:
      - apache

volumes:
  blaze-data:
networks:
  apache:
    external: true
alexanderkiel commented 2 years ago

Hi, the timezone on the log output of Blaze is set to UTC as you can see here. I could make use of the TZ env var to set it. Would you expect to have the log timestamps in your local timezone?

NamUKF commented 2 years ago

Hi, yes I normally expect the log files to be in the configured timezone of the vm. It makes trouble shooting easier.