Skip to content

Commit

Permalink
feat: init env file
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Sep 22, 2024
1 parent 60293dc commit 2d41adc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/api/server/route.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions public/docker-start/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# 如果 .env 文件不存在,则创建一个空的 .env 文件
if [ ! -f /app/.env ]; then
touch /app/.env
fi

# 启动服务
exec "$@"

0 comments on commit 2d41adc

Please sign in to comment.