#!/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;"