Skip to content

Commit 4b5fa9b

Browse files
committed
chore: 新增 PROFILES_ACTIVE 环境变量用于 Spring Profiles 配置
新手可以更加集中管理配置,适合多 profiles 场景
1 parent 7ac5124 commit 4b5fa9b

3 files changed

Lines changed: 2 additions & 2 deletions

File tree

continew-server/src/main/resources/config/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spring:
4646
## 环境配置
4747
profiles:
4848
# 启用的环境
49-
active: dev
49+
active: ${PROFILES_ACTIVE:dev}
5050
include:
5151
- generator
5252
main:

docker/continew-admin/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ ENTRYPOINT ["java", \
1111
"-jar", \
1212
"-XX:+UseZGC", \
1313
"-Djava.security.egd=file:/dev/./urandom", \
14-
"-Dspring.profiles.active=prod", \
1514
"app.jar"]

docker/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ services:
6363
- /docker/continew-admin/lib/:/app/lib/
6464
environment:
6565
TZ: Asia/Shanghai
66+
PROFILES_ACTIVE: prod
6667
DB_HOST: 172.17.0.1
6768
DB_PORT: 3306
6869
DB_USER: 你的数据库用户名

0 commit comments

Comments
 (0)