blaze icon indicating copy to clipboard operation
blaze copied to clipboard

Zeitzone Docker Container Blaze FHIR Server

Open NamUKF opened this issue 2 years ago • 2 comments

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

NamUKF avatar Aug 11 '22 12:08 NamUKF

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?

alexanderkiel avatar Aug 16 '22 16:08 alexanderkiel

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

NamUKF avatar Aug 17 '22 07:08 NamUKF