From bf1b311e03f030cc80d95502cbcbafce7f510ef0 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Tue, 18 Nov 2025 10:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 26 +++++++++++++++++++ app/components/DevelopNews.vue | 4 +-- app/pages/{article => article-xlqx}/[id].vue | 0 app/pages/{article => article-xlqx}/index.vue | 0 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 Dockerfile rename app/pages/{article => article-xlqx}/[id].vue (100%) rename app/pages/{article => article-xlqx}/index.vue (100%) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..36cf685 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM node:22.17.1-alpine + + +LABEL maintainer="windowbird" + + +ENV NODE_ENV=production \ + NUXT_HOST=0.0.0.0 \ + PORT=3012 + +#5、容器内创建目录/nuxt4 +RUN mkdir -p /nuxt4 +#6、复制当前的内容到容器内容部目录/nuxt4 +COPY . ./nuxt4 +#7、切换工作目录到/nuxt4 +WORKDIR /nuxt4 + +# 健康检查 +HEALTHCHECK --interval=30s --timeout=3s \ + CMD curl -f http://localhost:3012/_nuxt/health || exit 1 + +# 暴露端口 +EXPOSE 3012 + +# 启动命令(显式指定端口) +CMD ["node", "./server/index.mjs", "--port", "3012", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/app/components/DevelopNews.vue b/app/components/DevelopNews.vue index 7bc7d0e..047c9d0 100644 --- a/app/components/DevelopNews.vue +++ b/app/components/DevelopNews.vue @@ -37,7 +37,7 @@ const formatTime = (timeString: string): string => { // 获取文章链接 const getArticleLink = (articleId: string): string => { - return `/article/${articleId}` + return `/article-xlqx/${articleId}` } // 获取显示的文章列表(每个分类显示前2篇文章) @@ -181,7 +181,7 @@ onMounted(() => {