mirror of
https://github.com/oiov/wr.do.git
synced 2026-05-06 21:50:22 +08:00
feats(docker): add check db script
This commit is contained in:
@@ -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
|
||||
|
||||
23
README-zh.md
23
README-zh.md
@@ -14,15 +14,22 @@
|
||||
- <20>😀 **权限管理**:方便审核的管理员面板
|
||||
- 🔒 **安全可靠**:基于 Cloudflare 强大的 DNS API
|
||||
|
||||
## Screenshots
|
||||
## 截图预览
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/light-preview.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/example_02.png" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/example_01.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/realtime-globe.png" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/example_03.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/domains.png" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 快速开始
|
||||
|
||||
|
||||
26
README.md
26
README.md
@@ -17,13 +17,21 @@
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/light-preview.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/example_02.png" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/example_01.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/realtime-globe.png" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/example_03.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/domains.png" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 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
|
||||
- 微信群:
|
||||
|
||||

|
||||
<img width="300" src="https://wr.do/s/group" />
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,13 +15,20 @@ description: Welcome to the WR.DO documentation.
|
||||
|
||||
## Screenshots
|
||||
|
||||
<img className="rounded-xl border mt-4 md:rounded-lg shadow-md" src="/_static/images/light-preview.png"/>
|
||||
|
||||
<img className="rounded-xl border mt-4 md:rounded-lg shadow-md" src="/_static/images/example_02.png"/>
|
||||
|
||||
<img className="rounded-xl border mt-4 md:rounded-lg shadow-md" src="/_static/images/example_01.png"/>
|
||||
|
||||
<img className="rounded-xl border mt-4 md:rounded-lg shadow-md" src="/_static/images/example_03.png"/>
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/light-preview.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/example_02.png" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/example_01.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/realtime-globe.png" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://wr.do/_static/images/example_03.png" /></td>
|
||||
<td><img src="https://wr.do/_static/images/domains.png" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Quick Start
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
BIN
public/_static/images/domains.png
Normal file
BIN
public/_static/images/domains.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 219 KiB |
BIN
public/_static/images/realtime-globe.png
Normal file
BIN
public/_static/images/realtime-globe.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
25
scripts/entrypoint.sh
Normal file
25
scripts/entrypoint.sh
Normal file
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user