kevisual-center/docker/app-init.sh
2024-10-14 00:46:54 +08:00

17 lines
340 B
Bash

#!/bin/sh
# 宿主机挂载路径
TARGET_DIR="/app"
# 检查目录是否为空
if [ -z "$(ls -A $TARGET_DIR)" ]; then
echo "Directory is empty. Copying default content..."
cp -r /default-app/* $TARGET_DIR/
else
echo "Directory is not empty. Skipping copy."
fi
# 启动应用或保持容器运行
# exec "$@"
nginx -g "daemon off;"