ludu-cloud/ludu-module-datacenter/ludu-module-datacenter-biz/run.sh

15 lines
522 B
Bash
Raw Normal View History

2024-08-30 11:57:01 +08:00
app_name='ludu-module-datacenter'
2024-08-13 14:36:48 +08:00
# 定义应用版本
2024-08-30 11:23:38 +08:00
app_version='1.0.0'
2024-08-13 14:36:48 +08:00
# 定义应用环境
2024-10-28 16:12:08 +08:00
# 打包编译docker镜像
echo '----build image----'
docker buildx build -f Dockerfile -t ${app_name}:${app_version} .
2024-08-13 14:36:48 +08:00
echo '----stop container----'
docker stop ${app_name}
echo '----rm container----'
docker rm ${app_name}
2024-10-28 16:12:08 +08:00
echo '----rmi none image----'
docker rmi $(docker images -f "dangling=true" -q)
2024-08-13 14:36:48 +08:00
echo '----start container----'
2024-10-28 16:12:08 +08:00
docker run -d -p 48092:48092 --name ${app_name} --restart always ${app_name}:${app_version}