feat(13): 配置prod、dev环境

This commit is contained in:
2025-10-08 20:58:17 +08:00
parent 1e22b202db
commit 8cb96e7d30
3 changed files with 10 additions and 10 deletions
Vendored
+4 -4
View File
@@ -1,8 +1,8 @@
pipeline {
agent none // 全局不指定,局部自己声明
environment {
IMAGE_NAME = 'lpt:0.0'
CONTAINER_NAME = 'LPT'
IMAGE_NAME = 'lpt-prod:0.0'
CONTAINER_NAME = 'LPT-prod'
HOST_PORT = '5157'
CONTAINER_PORT = '5157'
}
@@ -31,9 +31,9 @@ pipeline {
steps {
sh '''
docker rm -f $CONTAINER_NAME || true
docker run -d --name $CONTAINER_NAME --network mysql_default \\
docker run -d --name $CONTAINER_NAME --network prod_mysql-prod \\
--restart=always \\
-p $HOST_PORT:$CONTAINER_PORT -e SPRING_PROFILES_ACTIVE=dev \\
-p $HOST_PORT:$CONTAINER_PORT -e SPRING_PROFILES_ACTIVE=prod \\
--log-driver=loki \\
--log-opt loki-url="http://192.168.123.199:3100/loki/api/v1/push" \\
$IMAGE_NAME
+4 -4
View File
@@ -1,10 +1,10 @@
pipeline {
agent none // 全局不指定,局部自己声明
environment {
IMAGE_NAME = 'lpt:0.0'
CONTAINER_NAME = 'LPT'
HOST_PORT = '5157'
CONTAINER_PORT = '5157'
IMAGE_NAME = 'lpt-dev:0.0'
CONTAINER_NAME = 'LPT-dev'
HOST_PORT = '5156'
CONTAINER_PORT = '5156'
}
stages {
stage('Build') {
@@ -2,9 +2,9 @@ spring:
# 配置数据库
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://mysql8:3306/learning_progress_tracker?allowPublicKeyRetrieval=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://mysql8:3307/lpt_prod?allowPublicKeyRetrieval=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: GUOxy5157
password: GUOxy.5157
server:
port: 5157