mirror of
https://gitee.com/kennylee/docker.git
synced 2024-12-01 19:38:30 +08:00
更新springboot构建镜像脚本
This commit is contained in:
parent
8e54b57850
commit
17e68dfddc
@ -9,5 +9,7 @@
|
||||
3. 运行命令 `docker-compose up -d`
|
||||
4. `alpine` 环境容器,因为比较小,但缺点是中文支持不了,也不适用于一些对服务器运行的本地开发环境比较高依赖的应用。而`ubuntu`版本的容器支持中文,容器内资源比较丰富,体积也大了许多。
|
||||
|
||||
|
||||
### 例子jar接口
|
||||
|
||||
> http://localhost:8080/user/1
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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 "$@"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user