Files
knowai/Dockerfile
tobegold574 b44d3ba80a fix(Doc): 重新确定分支职责,删除原architecture-nuxt3分支 feat(image):
完成knowai-base:1.0.0的推送,同时上传了对应Dockerfile
2025-11-04 14:24:10 +08:00

70 lines
2.2 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ------------------------------------------------
# 基础镜像Node LTSDebian trixie-slim
# ------------------------------------------------
FROM node:lts-trixie-slim
WORKDIR /usr/src/app
ENV PNPM_HOME=/pnpm-global
ENV PATH=$PNPM_HOME:$PATH
ENV SHELL=/bin/sh
# ------------------------------------------------
# 安装 pnpm 并配置国内源
# ------------------------------------------------
RUN npm install -g pnpm && \
pnpm config set registry https://registry.npmmirror.com
# 在 Dockerfile 里替换源
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian trixie main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security trixie-security main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian trixie-updates main contrib non-free" >> /etc/apt/sources.list
# ------------------------------------------------
# 更新系统工具(最小化依赖)
# ------------------------------------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
# ------------------------------------------------
# 安装运行时核心依赖(支持 SSR + CSR
# ------------------------------------------------
RUN pnpm add -g \
nuxt@latest \
vue@latest \
vue-router@latest \
@vueuse/core \
@pinia/nuxt \
pinia-plugin-persistedstate \
@element-plus/nuxt \
@element-plus/icons-vue \
@nuxtjs/tailwindcss \
@nuxt/image \
@nuxt/icon \
@nuxtjs/color-mode \
@nuxtjs/component-cache \
axios \
node-fetch \
socket.io-client \
lodash \
dayjs \
crypto-js
# ------------------------------------------------
# 版本验证
# ------------------------------------------------
RUN echo "✅ Node 版本:" && node -v && \
echo "✅ pnpm 版本:" && pnpm -v && \
echo "✅ Nuxt 版本:" && pnpm dlx nuxt --version || true
# ------------------------------------------------
# 默认端口
# ------------------------------------------------
EXPOSE 3000
# ------------------------------------------------
# 启动方式
# ------------------------------------------------
CMD ["bash"]