diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 00000000..38cd1aee --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +JAVA_OPTS="-Xms128m -Xmx128m" + +CONF="--mysql.host=10.1.30.120:3306 --register.url=10.1.30.110:8848" + +nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-gateway/sop-gateway.jar $CONF --logging.file.path=/sop/sop-gateway/log > /dev/null 2>&1 & +nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-admin/sop-admin.jar $CONF --logging.file.path=/sop/sop-admin/log > /dev/null 2>&1 & +nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-website/sop-website.jar $CONF --logging.file.path=/sop/sop-website/log > /dev/null 2>&1 & +nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-auth/sop-auth.jar $CONF --logging.file.path=/sop/sop-auth/log > /dev/null 2>&1 & +nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-story/sop-story.jar $CONF --logging.file.path=/sop/sop-story/log > /dev/null 2>&1 & + diff --git a/dockerfile b/dockerfile index 26678a73..f943dc5b 100644 --- a/dockerfile +++ b/dockerfile @@ -8,17 +8,4 @@ ADD sop-website/target/*.jar sop/sop-website/sop-website.jar ADD sop-auth/target/*.jar sop/sop-website/sop-auth.jar ADD sop-example/sop-story/target/*.jar sop/sop-story/sop-story.jar -# JVM设置 -ENV JAVA_OPTS="-Xms128m -Xmx128m" - -# springboot配置文件 -# --logging.file:日志 -# --mysql.host:mysql地址 -# --register.url:nacos地址 -ENV CONF="--mysql.host=10.1.30.120:3306 --register.url=10.1.30.110:8848" - -ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-gateway/sop-gateway.jar ${CONF} --logging.file.path=/sop/sop-gateway/log \ -&& java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-admin/sop-admin.jar ${CONF} --logging.file.path=/sop/sop-admin/log \ -&& java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-website/sop-website.jar ${CONF} --logging.file.path=/sop/sop-website/log \ -&& java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-auth/sop-auth.jar ${CONF} --logging.file.path=/sop/sop-auth/log \ -&& java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-story/sop-story.jar ${CONF} --logging.file.path=/sop/sop-story/log +ENTRYPOINT ["docker-entrypoint.sh"]