diff --git a/app/api/server/route.ts b/app/api/server/route.ts index 6653a6ebc..21fd43653 100644 --- a/app/api/server/route.ts +++ b/app/api/server/route.ts @@ -1,6 +1,8 @@ import { GetNezhaData } from "@/lib/serverFetch"; import { NextResponse } from "next/server"; +export const dynamic = "force-dynamic"; + export async function GET(_: Request) { try { const response = await GetNezhaData(); diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 03617d746..832c9e69c 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,6 +2,7 @@ services: nezha-dash: container_name: nezha-dash image: registry.cn-guangzhou.aliyuncs.com/hamster-home/nezha-dash:latest + entrypoint: /app/public/docker-start/docker-entrypoint.sh volumes: - ./.env:/app/.env restart: always diff --git a/public/docker-start/docker-entrypoint.sh b/public/docker-start/docker-entrypoint.sh new file mode 100644 index 000000000..e346dcfd6 --- /dev/null +++ b/public/docker-start/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# 如果 .env 文件不存在,则创建一个空的 .env 文件 +if [ ! -f /app/.env ]; then + touch /app/.env +fi + +# 启动服务 +exec "$@"