diff --git a/Dockerfile b/Dockerfile index 5ba3c36..8449145 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,20 @@ # 使用官方 Node.js 镜像 -# FROM node:20-alpine AS builder +FROM node:20-alpine AS builder # 设置工作目录 -# WORKDIR /usr/src/app +WORKDIR /usr/src/app # 复制 package.json 和 package-lock.json -# COPY package.json ./ +COPY package.json ./ # 安装依赖 -# RUN npm install +RUN npm install # 复制应用代码 -# COPY . . +COPY . . # 执行构建 -# RUN npm run build +RUN npm run build # 使用 Alpine 作为最终镜像 FROM node:20-alpine @@ -23,14 +23,13 @@ FROM node:20-alpine WORKDIR /usr/src/app # 复制构建结果 -COPY .next /usr/src/app/dist +COPY --from=builder /usr/src/app/.next dist # 安装 PM2 RUN npm install -g pm2 # 使用 PM2 启动应用 -CMD ["node", "dist/standalone/server.js"] -# "start", "ecosystem.config.js" +CMD ["pm2-runtime", "start", "ecosystem.config.js"] # 暴露端口 EXPOSE 3000 \ No newline at end of file diff --git a/Dockerfile copy 2 b/Dockerfile copy 2 new file mode 100644 index 0000000..5ba3c36 --- /dev/null +++ b/Dockerfile copy 2 @@ -0,0 +1,36 @@ +# 使用官方 Node.js 镜像 +# FROM node:20-alpine AS builder + +# 设置工作目录 +# WORKDIR /usr/src/app + +# 复制 package.json 和 package-lock.json +# COPY package.json ./ + +# 安装依赖 +# RUN npm install + +# 复制应用代码 +# COPY . . + +# 执行构建 +# RUN npm run build + +# 使用 Alpine 作为最终镜像 +FROM node:20-alpine + +# 设置工作目录 +WORKDIR /usr/src/app + +# 复制构建结果 +COPY .next /usr/src/app/dist + +# 安装 PM2 +RUN npm install -g pm2 + +# 使用 PM2 启动应用 +CMD ["node", "dist/standalone/server.js"] +# "start", "ecosystem.config.js" + +# 暴露端口 +EXPOSE 3000 \ No newline at end of file diff --git a/README.md b/README.md index 7cd31f8..58a8f4f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# ameison_blog - +WEB主页-端口9001 \ No newline at end of file diff --git a/app/favicon.ico b/app/favicon.ico index 718d6fe..3f89955 100644 Binary files a/app/favicon.ico and b/app/favicon.ico differ diff --git a/app/page copy.tsx b/app/page copy.tsx new file mode 100644 index 0000000..03c2776 --- /dev/null +++ b/app/page copy.tsx @@ -0,0 +1,119 @@ +import Image from "next/image"; + +export default function Home() { + return ( +
+
+

+ Get started by editing  + app/page.tsx +

+
+ + By{" "} + Vercel Logo + +
+
+ +
+ Next.js Logo +
+ +
+ +

+ Docs{" "} + + -> + +

+

+ Find in-depth information about Next.js features and API. +

+
+ + +

+ Learn{" "} + + -> + +

+

+ Learn about Next.js in an interactive course with quizzes! +

+
+ + +

+ Templates{" "} + + -> + +

+

+ Explore starter templates for Next.js. +

+
+ + +

+ Deploy{" "} + + -> + +

+

+ Instantly deploy your Next.js site to a shareable URL with Vercel. +

+
+
+
+ Copyright © 2024-2025 + uuzs.cn + 版权所有 + 湘ICP备2024077497号 +
+
+ ); +} diff --git a/app/page.tsx b/app/page.tsx index 5705d4e..f151a6e 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,113 +1,27 @@ -import Image from "next/image"; - export default function Home() { return ( -
-
-

- Get started by editing  - app/page.tsx -

-
- - By{" "} - Vercel Logo - +
+
+
+

+ Ameison的网站 +

-
- -
- Next.js Logo -
- -
- -

- Docs{" "} - - -> - -

-

- Find in-depth information about Next.js features and API. -

+
+
+ Copyright © 2024-2025 + + uuzs.cn - + 版权所有 -

- Learn{" "} - - -> - -

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

- Templates{" "} - - -> - -

-

- Explore starter templates for Next.js. -

-
- - -

- Deploy{" "} - - -> - -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

+ 湘ICP备2024077497号
- + ); } diff --git a/package.json b/package.json index 49055d2..3f42a10 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "my-app", + "name": "ameison", "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev -p 9000", + "dev": "next dev -p 9001", "build": "next build && npm run move", "start": "next start", "lint": "next lint",