diff --git a/docker-build.sh b/docker-build.sh new file mode 100644 index 00000000..f4d43e59 --- /dev/null +++ b/docker-build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +mvn clean package +docker build -t sop . diff --git a/dockerfile b/dockerfile new file mode 100644 index 00000000..5b131e4e --- /dev/null +++ b/dockerfile @@ -0,0 +1,23 @@ +FROM java:8 +VOLUME /tmp +VOLUME /sop + +ADD sop-gateway/target/*.jar sop/sop-gateway.jar +ADD sop-admin/sop-admin-server/target/*.jar sop/sop-admin.jar +ADD sop-website/target/*.jar sop/sop-website.jar +ADD sop-example/sop-story/target/*.jar sop/sop-story.jar + + +# JVM设置 +ENV JAVA_OPTS="-Xms128m -Xmx128m" + +# springboot配置文件 +# --logging.file:日志 +# --mysql.host:mysql地址 +# --register.url:nacos地址 +ENV CONF="--logging.file=log/spring.log --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.jar ${CONF} +ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-admin.jar ${CONF} +ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-website.jar ${CONF} +ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-story.jar ${CONF} diff --git a/sop-gateway/src/main/docker/dockerfile b/sop-gateway/src/main/docker/dockerfile index 44bda9ad..424ef75f 100644 --- a/sop-gateway/src/main/docker/dockerfile +++ b/sop-gateway/src/main/docker/dockerfile @@ -3,8 +3,13 @@ VOLUME /tmp VOLUME /log ADD *.jar app.jar +# JVM设置 ENV JAVA_OPTS="-Xms128m -Xmx128m" + # springboot配置文件 -ENV CONF=" --logging.file=log/spring.log --mysql.host=10.1.30.120:3306 --register.url=10.1.30.110:8848" +# --logging.file:日志 +# --mysql.host:mysql地址 +# --register.url:nacos地址 +ENV CONF="--logging.file=log/spring.log --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 /app.jar ${CONF} \ No newline at end of file