random-api-go/start.sh
wood chen 1fc1069ec1 refactor(docker, config): streamline directory structure and enhance configuration management
- Removed unnecessary volume mounts for public and logs in docker-compose.yml.
- Updated Dockerfile to create necessary directories under /root/data.
- Modified start.sh to copy files to the new public directory location.
- Enhanced config.go to create default configuration and directory structure if not present.
- Adjusted router.go to serve static files from the new public directory path.
2024-11-30 23:34:45 +08:00

14 lines
288 B
Bash

#!/bin/sh
# 如果挂载的 public 目录为空,则从临时位置复制文件
if [ ! "$(ls -A /root/data/public)" ]; then
mkdir -p /root/data/public
cp -r /tmp/public/* /root/data/public/
fi
# 创建其他必要的目录
mkdir -p /root/data/logs
# 启动应用
./random-api