Commit 4fc9bb04 by tdgiang

Fix container timezone: set TZ=Asia/Ho_Chi_Minh (was defaulting to UTC)

Alpine base image ships no timezone data, so Date/moment() inside the
container fell back to UTC regardless of the host's real timezone -
every displayed timestamp (transaction list "Thời gian" column, CSV
export) and every signed timeStamp (epay merchantToken) was 7 hours
behind actual Vietnam time. Installs tzdata and sets TZ in both the
Dockerfile and docker-compose.yml (belt and suspenders - either alone
would fix it, but the compose env var makes it visible without having
to read the Dockerfile).

Verified by building the actual image and running new Date()/moment()
inside it: correctly shows GMT+0700 (Indochina Time) after the fix,
was UTC before.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KPzWwuTEeX2vXGXvyGn4q
parent 052622b2
FROM node:20-alpine FROM node:20-alpine
# Alpine images have no timezone data by default - without this, Date/moment()
# fall back to UTC inside the container regardless of the host's real timezone,
# which showed up as every displayed/signed timestamp being 7 hours behind
# actual Vietnam time (UTC+7, no DST).
RUN apk add --no-cache tzdata
ENV TZ=Asia/Ho_Chi_Minh
WORKDIR /app WORKDIR /app
# Install dependencies first so this layer is cached unless package*.json changes. # Install dependencies first so this layer is cached unless package*.json changes.
......
...@@ -7,6 +7,7 @@ services: ...@@ -7,6 +7,7 @@ services:
NODE_ENV: production NODE_ENV: production
REDIS_HOST: redis REDIS_HOST: redis
REDIS_PORT: 6379 REDIS_PORT: 6379
TZ: Asia/Ho_Chi_Minh
ports: ports:
# Host port 7003 chosen because this VPS is shared with many other # Host port 7003 chosen because this VPS is shared with many other
# services; 3003 (and most of the 3000-3003/8080-8090/9000-9080 range) # services; 3003 (and most of the 3000-3003/8080-8090/9000-9080 range)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment