Commit 73469306 by wangguangchao

修改打包方式

parent 7c11cf0a
......@@ -4,17 +4,16 @@ FROM adoptopenjdk/openjdk8:x86_64-alpine-jdk8u382-b05
MAINTAINER R&D(WH)@brilliance.com.cn
USER root
ENV APP_NAME="eureka-server" \
WORKDIR=/workspace
ENV WORKDIR=/workspace
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
&& apk update \
&& apk add unzip
ADD ./target/eureka-server-1.0-SNAPSHOT.zip .
ADD ./target/*.zip ./app.zip
RUN echo "starting RUN command" && \
unzip -qo eureka-server-1.0-SNAPSHOT.zip -d $WORKDIR && \
unzip -qo app.zip -d $WORKDIR && \
chmod -R 772 $WORKDIR && \
chmod 772 $WORKDIR/config && \
chmod 772 $WORKDIR/bin
......
# 基于哪个镜像
From java:8
# 复制文件到容器
ADD ./target/eureka-server-1.0-SNAPSHOT.jar /app.jar
# 声明需要暴露的端口
EXPOSE 8769
# 配置容器启动后执行的命令
ENTRYPOINT java ${JAVA_OPTS} -jar /app.jar
\ No newline at end of file
# 给当前服务取一个名字
spring.application.name=eureka
# 设置端口号
server.port=8769
logging.config=classpath:logback.xml
# Eureka Server 也是一个普通的微服务,所以当它还是一个注册中心的时候,他会有两层身份:1.注册中心;2.普通服务。
# 默认情况下,会把自己注册到自己上面来,设置为 false 时,表示当前项目不要注册到注册中心上
eureka.client.register-with-eureka=false
# 表示是否从 Eureka Server 上获取注册信息
eureka.client.fetch-registry=false
@echo off
@setlocal
REM set JUP SERVICE HOME
set "APP_WRK_HOME=%~dp0"
set "APP_WRK_HOME=%APP_WRK_HOME:~0,-4%"
set "APP_NAME=EUREKA-SERVER"
REM find boot jar file path
for %%i in (%APP_WRK_HOME%/*.jar) do set BOOT_JAR=%%i
set "JAVACMD=%JAVA_HOME%/bin/java.exe"
REM set "JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx512m"
set "JAVA_OPTS=%JAVA_OPTS% -Dlogging.path=%APP_WRK_HOME%"
set "JAVA_OPTS=%JAVA_OPTS% -Dlogging.file=%APP_WRK_HOME%/logs/application.log"
rem the file skywalking-agent.jar is used at the link to track.
rem When deploying, please follow the actural situation to modify the path or version and modify the agent.config configuration file in agent/config.
rem Please refer to the configuration document to modify the contents of the configuration item collector.backend_service in agent.config
rem set "JAVA_OPTS=%JAVA_OPTS% -javaagent:d:/jup/services/JavaUnifiedPlatform_APM_Center_0.4-RELEASE/agent/skywalking-agent.jar"
rem set "JAVA_OPTS=%JAVA_OPTS% -DSW_AGENT_NAME=HK-BUSINESS"
set "JAVA_OPTS=%JAVA_OPTS% -server -Djava.net.preferIPv4Stack=true -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=GBK -Dfile.encoding=GBK"
set "JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError"
REM execute
start "%APP_NAME%" "%JAVACMD%" %JAVA_OPTS% -jar %BOOT_JAR%
\ No newline at end of file
......@@ -7,7 +7,6 @@ echoYellow() { echo $'\e[0;33m'"$1"$'\e[0m'; }
#启动脚本的主目录
PRG="$0"
ENV="$1"
APP_WRK_HOME=`dirname "$PRG"`/..
APP_WRK_HOME=`cd "$APP_WRK_HOME" && pwd`
......@@ -32,7 +31,6 @@ dostart() {
echoYellow "warn: $APP_NAME already started! (pid=$psid)"
else
export JAVA_OPTS="$JAVA_OPTS -Dlogging.path=$APP_WRK_HOME"
export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=$ENV"
export JAVA_OPTS="$JAVA_OPTS -server -Djava.net.preferIPv4Stack=true -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
export JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx2048m"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment