diff --git a/Dockerfile b/Dockerfile index 1fa918d..e4c8c54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,10 @@ COPY --from=builder /app/prisma ./prisma COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static +# Check db +COPY scripts/entrypoint.sh /app/scripts/entrypoint.sh +RUN chmod +x /app/scripts/entrypoint.sh + EXPOSE 3000 ENV HOSTNAME=0.0.0.0 diff --git a/README-zh.md b/README-zh.md index 4d0acaa..6f6641b 100644 --- a/README-zh.md +++ b/README-zh.md @@ -14,15 +14,22 @@ - �😀 **权限管理**:方便审核的管理员面板 - 🔒 **安全可靠**:基于 Cloudflare 强大的 DNS API -## Screenshots +## 截图预览 -![screenshot](https://wr.do/_static/images/light-preview.png) - -![screenshot](https://wr.do/_static/images/example_01.png) - -![screenshot](https://wr.do/_static/images/example_02.png) - -![screenshot](https://wr.do/_static/images/example_03.png) + + + + + + + + + + + + + +
## 快速开始 diff --git a/README.md b/README.md index 7abcc17..c4ed68d 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,21 @@ ## Screenshots -![screenshot](https://wr.do/_static/images/light-preview.png) + + + + + + + + + + + + + +
-![screenshot](https://wr.do/_static/images/example_02.png) - -![screenshot](https://wr.do/_static/images/example_01.png) - -![screenshot](https://wr.do/_static/images/example_03.png) ## Quick Start @@ -50,7 +58,9 @@ Remember to fill in the necessary environment variables. ### Deploy with Docker Compose -Fill in the environment variables in the `docker-compose.yml`, then: +Create a new folder and copy the `docker-compose.yml` file to the folder. + +Touch a `.env` file at the same level and fill in the environment variables, then: ```bash docker compose up -d @@ -87,7 +97,7 @@ Follow https://localhost:3000/setup - Discord: https://discord.gg/AHPQYuZu3m - 微信群: -![](https://wr.do/s/group) + ## License diff --git a/content/docs/developer/deploy.mdx b/content/docs/developer/deploy.mdx index a9e6f83..eccbdb1 100644 --- a/content/docs/developer/deploy.mdx +++ b/content/docs/developer/deploy.mdx @@ -11,7 +11,9 @@ Remember to fill in the necessary environment variables. ## Deploy with Docker Compose -Fill in the environment variables in the `docker-compose.yml`, then: +Create a new folder and copy the `docker-compose.yml` file to the folder. + +Touch a `.env` file at the same level and fill in the environment variables, then: ```bash docker compose up -d diff --git a/content/docs/index.mdx b/content/docs/index.mdx index 750cb05..accb94c 100644 --- a/content/docs/index.mdx +++ b/content/docs/index.mdx @@ -15,13 +15,20 @@ description: Welcome to the WR.DO documentation. ## Screenshots - - - - - - - + + + + + + + + + + + + + +
## Quick Start diff --git a/middleware.ts b/middleware.ts index d6b907e..5414cc0 100644 --- a/middleware.ts +++ b/middleware.ts @@ -57,7 +57,7 @@ async function handleShortUrl(req: NextAuthRequest) { password, }; - console.log("Tracking data:", trackingData, siteConfig.url); + // console.log("Tracking data:", trackingData, siteConfig.url); const res = await fetch(`${siteConfig.url}/api/s`, { method: "POST", diff --git a/public/_static/images/domains.png b/public/_static/images/domains.png new file mode 100644 index 0000000..a0c975d Binary files /dev/null and b/public/_static/images/domains.png differ diff --git a/public/_static/images/realtime-globe.png b/public/_static/images/realtime-globe.png new file mode 100644 index 0000000..66ce3c3 Binary files /dev/null and b/public/_static/images/realtime-globe.png differ diff --git a/public/_static/images/realtime.png b/public/_static/images/realtime.png deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh new file mode 100644 index 0000000..58452c7 --- /dev/null +++ b/scripts/entrypoint.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# scripts/entrypoint.sh + +# 数据库初始化 + +retries=3 # 重试次数 +count=0 +echo "Running database initialization..." +until pnpm db:push || [ $count -ge $retries ]; do + echo "Database initialization failed, retrying ($((count + 1))/$retries)..." + count=$((count + 1)) + sleep 5 +done + +# 检查是否成功 +if [ $count -ge $retries ]; then + echo "Database initialization failed after $retries attempts." + exit 1 +fi + +echo "Database initialization successful." + +# 执行原始的启动命令 +echo "Starting the application..." +exec "$@" \ No newline at end of file