docker-webman-jsonrpc/php
2023-11-11 13:23:35 +08:00

22 lines
549 B
Bash
Executable File

#!/bin/bash
set -e
source docker.conf
export WORKERMAN_CONTAINER_NAME=$container_name
export WORKERMAN_IMAGE_VERSION=$image_version
# 判断容器是否存在
if [ ! "$(docker ps -a -q -f name=$WORKERMAN_CONTAINER_NAME)" ]; then
# 调用init脚本
./init
fi
# 判断容器是否在运行
if [ ! "$(docker inspect -f {{.State.Running}} $WORKERMAN_CONTAINER_NAME)" = "true" ]; then
# 启动容器
docker start $WORKERMAN_CONTAINER_NAME
fi
# 进入容器并执行php命令
docker exec -it $WORKERMAN_CONTAINER_NAME bash -c "php $*"