更新springboot构建镜像脚本

This commit is contained in:
KennyLee 2018-05-30 09:37:08 +08:00
parent 8e54b57850
commit 17e68dfddc
3 changed files with 10 additions and 6 deletions

View File

@ -9,5 +9,7 @@
3. 运行命令 `docker-compose up -d`
4. `alpine` 环境容器,因为比较小,但缺点是中文支持不了,也不适用于一些对服务器运行的本地开发环境比较高依赖的应用。而`ubuntu`版本的容器支持中文,容器内资源比较丰富,体积也大了许多。
### 例子jar接口
> http://localhost:8080/user/1

View File

@ -6,10 +6,11 @@ services:
- ./app/:/data/app/
- ./config/application.yml:/data/config/application.yml:ro
environment:
JAVA_OPTS: ${LTS_TASKTRACKER_JAVA_OPTS}
JAVA_OPTS: -server -Xms128m -Xmx1g -Djava.security.egd=file:/dev/./urandom
ports:
- "8080:8080"
command:
entrypoint:
- /entrypoint.sh
- --spring.config.location=/data/config/application.yml
logging:
driver: 'json-file'

View File

@ -6,12 +6,13 @@ APP_FILE=${BASE_PATH}app.jar
if [ ${#ORI_APP_FILE} -gt 0 ]; then
echo "create symbolic link for $ORI_APP_FILE"
if [ -f $APP_FILE ]; then
if [ -e $APP_FILE ]; then
#echo "$APP_FILE was existed, remove that."
rm $APP_FILE
rm -f $APP_FILE
fi
ln -s $ORI_APP_FILE $APP_FILE
fi
# if $APP_FILE not exist, let it throw error。
java -jar $APP_FILE "$@"
java $JAVA_OPTS -jar $APP_FILE "$@"