feat: 添加 Dockerfile run.sh
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
胥员员 2022-11-15 16:59:58 +08:00
parent c85e76cc26
commit 08d4161cad
2 changed files with 29 additions and 0 deletions

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM openjdk:8
VOLUME /tmp
ADD scenic-1.0-SNAPSHOT.jar app.jar
EXPOSE 8081
ENTRYPOINT ["java","-jar","app.jar"]

24
run.sh Normal file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# 定义应用组名
group_name='xyy'
# 定义应用名称
app_name='init'
# 定义应用版本
app_version='latest'
# 定义应用环境
profile_active='dev'
echo '----copy jar----'
docker stop ${app_name}
echo '----stop container----'
docker rm ${app_name}
echo '----rm container----'
docker rmi ${group_name}/${app_name}:${app_version}
echo '----rm image----'
# 打包编译docker镜像
docker build -t ${group_name}/${app_name}:${app_version} .
echo '----build image----'
docker run -p 0504:8081 --name ${app_name} \
-e TZ="Asia/Shanghai" \
-v /etc/localtime:/etc/localtime \
-d ${group_name}/${app_name}:${app_version}
echo '----start container----'