From 28a4560663f92f92af9104dd4822f06ed438ec43 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 24 一月 2025 13:37:25 +0800 Subject: [PATCH] dockerfile --- start/src/main/resources/application-prod.yml | 8 ++++---- start/src/docker/Dockerfile | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/start/src/docker/Dockerfile b/start/src/docker/Dockerfile new file mode 100644 index 0000000..6fdcd14 --- /dev/null +++ b/start/src/docker/Dockerfile @@ -0,0 +1,19 @@ +# 鍩虹闀滃儚 +FROM arm-jdk:17 +# 浣滆�� +MAINTAINER xp +# 宸ヤ綔鐩綍 +WORKDIR /usr/local/java +# 鍚屾docker鍐呴儴鐨勬椂闂� +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# 璁剧疆鏃跺尯 +ENV TZ=Asia/Shanghai +# java鏈嶅姟鐨勭鍙e彿锛屾毚闇插嚭鍘� +EXPOSE 10076 +# 澶嶅埗jar鍖呭埌/user/local/java涓� +# 瀹氫箟涓�涓彉閲忥紝鍙互鍦╞uild鐨勬椂鍊欓�氳繃 --build-arg JAR_FILE=/usr/xxx 鏉ヤ紶閫� 涓嶄紶榛樿灏卞湪宸ヤ綔鐩綍涓嬶紝寤鸿涓嶄紶鎴栬�呭垹闄よ繖涓懡浠わ紝 ADD鍛戒护鏀逛负 ./project-m.jar +ARG JAR_FILE +ADD ${JAR_FILE} ./project-m.jar + +# 杩愯jar鍖呯殑鍛戒护 +ENTRYPOINT ["nohup","java","-Dspring.profiles.active=prod","-Dspring.config.location=/usr/local/java/application.yml,/usr/local/java/application-prod.yml","-jar","/usr/local/java/project-m.jar",">","/usr/local/java/project-m.log","&>","&"] diff --git a/start/src/main/resources/application-prod.yml b/start/src/main/resources/application-prod.yml index 2cd4f1a..7f580e0 100644 --- a/start/src/main/resources/application-prod.yml +++ b/start/src/main/resources/application-prod.yml @@ -18,13 +18,13 @@ # redis 閰嶇疆 redis: # 鍦板潃 - host: localhost + host: 192.168.16.237 # 绔彛锛岄粯璁や负6379 port: 6379 # 鏁版嵁搴撶储寮� database: 2 # 瀵嗙爜 - password: ycl2018 + password: Redis@r # 杩炴帴瓒呮椂鏃堕棿 timeout: 10s lettuce: @@ -43,9 +43,9 @@ druid: # 涓诲簱鏁版嵁婧� master: - url: jdbc:mysql://localhost:3306/project_management?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://192.168.16.237:3306/project_management?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: 321$YcYl@1970! + password: Mysql@my # 浠庡簱鏁版嵁婧� slave: # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴 -- Gitblit v1.8.0