Open ijager opened 4 years ago
I found the solution already.
If you're working with meteor-up (mup)
Before I linked the/etc/localtime
file in mup.js
:
volumes: {
// passed as '-v /host/path:/container/path' to the docker run command
'/mnt/appdata/files': '/datafiles',
'/etc/timezone': '/etc/timezone',
'/etc/localtime': '/etc/localtime'
},
Now we have to set a environment variable TZ
:
env: {
// If you are using ssl, it needs to start with https://
ROOT_URL: ,
MONGO_URL:
PORT: 3000,
NODE_OPTIONS: '--max-old-space-size=512',
TZ: 'Europe/Amsterdam'
},
It will work perfectly if we did a change in file:
meteord/base/scripts/lib/cleanup.sh
by not to remove /usr/share/zoneinfo from the base container.
From
rm -rf /usr/share/doc /usr/share/doc-base /usr/share/man /usr/share/locale /usr/share/zoneinfo
To
rm -rf /usr/share/doc /usr/share/doc-base /usr/share/man /usr/share/locale
With this solution, we can use the TZ environment variable to set the container timezone without mapping host's timezone
and localtime
files.
I am in the CET timezone, which means that
new Date().getTimezoneOffset()
should return-60
at the moment. However it returns0
. As a result, all timestamps saved as UTC in my meteor app are wrong.Is there some breaking change I have missed? Is there a way to configure the timezone for node or meteor inside the
node-12-base
docker container?