Skip to content

Commit 81aaa4e

Browse files
committed
springboot 数据库密码改为从环境变量获取
1 parent 62fe6eb commit 81aaa4e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

springboot/src/main/resources/application.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ spring:
44
datasource:
55
url: jdbc:postgresql://localhost:5432/mm
66
username: postgres
7-
password: postgres
7+
# 数据库密码,从环境变量中获取,本地开发取默认值 postgres
8+
password: ${DB_PASSWORD:postgres}
89
driver-class-name: org.postgresql.Driver
910
# HikariCP 特有配置
1011
hikari:

0 commit comments

Comments
 (0)