build:修改docker构建配置与简化后端config

This commit is contained in:
jiangrui
2025-03-06 18:24:01 +08:00
parent e708524a41
commit e8f70b286e
7 changed files with 72 additions and 70 deletions

13
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# 如果配置目录下没有 .env 文件,则复制示例文件
if [ ! -f /app/config/.env ]; then
cp /app/.env.example /app/config/.env
echo "已创建默认配置文件 /app/config/.env请根据需要修改配置"
fi
# 创建配置文件软链接
ln -sf /app/config/.env /app/.env
# 启动 Nginx 和后端服务
nginx -g 'daemon off;' & npm run start