docker-webman-jsonrpc/console
2023-10-20 11:53:56 +08:00

19 lines
613 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 读取docker.conf文件
source docker.conf
# 设置系统环境变量
export WORKERMAN_CONTAINER_NAME=$container_name
export WORKERMAN_IMAGE_VERSION=$image_version
# 判断WORKERMAN_CONTAINER_NAME的docker容器是否存在如果存在删除它
if docker ps -a --format '{{.Names}}' | grep -q "^$WORKERMAN_CONTAINER_NAME$"; then
docker rm -f $WORKERMAN_CONTAINER_NAME
fi
if [[ $1 == "build" ]]; then
docker compose run --rm $WORKERMAN_CONTAINER_NAME php webman build:bin $image_version && cp .env build/
else
docker compose run --rm $WORKERMAN_CONTAINER_NAME php webman "$@"
fi