mirror of
https://github.com/woodchen-ink/random-api-go.git
synced 2025-07-18 05:42:01 +08:00
- 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.
14 lines
288 B
Bash
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
|