Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add custom time zone example #651

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/deploy-in-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ CNPMCORE_LOG_DIR=/var/log/cnpmcore
CNPMCORE_CONFIG_REGISTRY=https://your-registry.com
```

### 时区

时区可以通过环境变量`TZ`来设置,可以使用地区标识符如`Asia/Shanghai`,也可以使用时区标识符如`Etc/GMT-8`(东八区)、`Etc/GMT+8`(西八区),具体TZ列表见[List](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)。

```bash
TZ=Asia/Shanghai
```

### 使用 `config.prod.js` 覆盖

直接覆盖 `/usr/src/app/config/config.prod.js` 文件也可以实现生产配置自定义。
Expand Down Expand Up @@ -145,6 +153,7 @@ docker run -p 7001:7001 -it --rm \
-e CNPMCORE_REDIS_PORT=6379 \
-e CNPMCORE_REDIS_PASSWORD=your-redis-password \
-e CNPMCORE_REDIS_DB=1 \
-e TZ=Asia/Shanghai \
--name cnpmcore-prod cnpmcore
```

Expand Down
Loading