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(() => {