feat(docker): 安装 tzdata 并设置 TZ=Asia/Shanghai 以让 Node.js 使用上海时区

This commit is contained in:
shenjianZ committed 2025-08-02 09:56:38 +08:00
1 parent be59fa85de
commit 893fac1ff2
2 files changed
+6

No files matched your search

+4
View File
@@ -3,6 +3,10 @@ FROM node:20-alpine
WORKDIR /usr/src/app
COPY package*.json ./
│
# Set timezone to Asia/Shanghai │
RUN apk add --no-cache tzdata │
ENV TZ=Asia/Shanghai │
RUN npm install
COPY . .