浏览代码

解决docker下时区不一致的问题

zhh 6 年之前
父节点
当前提交
f6a302585a

+ 9 - 0
document/docker/docker-deploy.md

@@ -122,17 +122,26 @@ docker exec -it mongo mongo
 ### 部署mall-admin
 docker run -p 8080:8080 --name mall-admin \
 --link mysql:db \
+-v /etc/timezone:/etc/timezone \
+-v /etc/localtime:/etc/localtime \
+-v /mydata/app/admin/logs:/var/logs \
 -d mall/mall-admin:0.0.1-SNAPSHOT
 ### 部署mall-search
 docker run -p 8081:8081 --name mall-search \
 --link elasticsearch:es \
 --link mysql:db \
+-v /etc/timezone:/etc/timezone \
+-v /etc/localtime:/etc/localtime \
+-v /mydata/app/search/logs:/var/logs \
 -d mall/mall-search:0.0.1-SNAPSHOT
 ### 部署mall-port
 docker run -p 8085:8085 --name mall-portal \
 --link mysql:db \
 --link redis:redis \
 --link mongo:mongo \
+-v /etc/timezone:/etc/timezone \
+-v /etc/localtime:/etc/localtime \
+-v /mydata/app/portal/logs:/var/logs \
 -d mall/mall-portal:0.0.1-SNAPSHOT
 
 ## SpringBoot应用自动化部署

+ 3 - 0
mall-portal/src/main/resources/application-prod.properties

@@ -2,6 +2,9 @@
 server.port=8085
 #===server end===
 
+#\u914D\u7F6E\u65E5\u5FD7\u751F\u6210\u8DEF\u5F84
+logging.path=/var/logs
+
 #===datasource start===
 spring.datasource.url=jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8
 spring.datasource.username=reader

+ 3 - 0
mall-search/src/main/resources/application-prod.properties

@@ -4,6 +4,9 @@ spring.datasource.username=reader
 spring.datasource.password=123456
 #===datasource end===
 
+#\u914D\u7F6E\u65E5\u5FD7\u751F\u6210\u8DEF\u5F84
+logging.path=/var/logs
+
 #===druid start===
 #\u8FDE\u63A5\u6C60\u521D\u59CB\u5316\u5927\u5C0F
 spring.datasource.druid.initial-size=5