docker更新
Some checks failed
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / generate (macos-latest) (push) Has been cancelled
CI / generate (ubuntu-latest) (push) Has been cancelled
CI / generate (windows-latest) (push) Has been cancelled
Publish Any Commit / publish (push) Has been cancelled
Some checks failed
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / generate (macos-latest) (push) Has been cancelled
CI / generate (ubuntu-latest) (push) Has been cancelled
CI / generate (windows-latest) (push) Has been cancelled
Publish Any Commit / publish (push) Has been cancelled
This commit is contained in:
@@ -6,16 +6,8 @@ yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# 构建输出
|
||||
.nuxt
|
||||
.output
|
||||
dist
|
||||
|
||||
# 环境变量文件
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
|
||||
# 日志文件
|
||||
*.log
|
||||
|
104
.github/nuxt.config.ts
vendored
104
.github/nuxt.config.ts
vendored
@@ -1,104 +0,0 @@
|
||||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
|
||||
const currentDir = dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
export default defineNuxtConfig({
|
||||
modules: [
|
||||
'shadcn-nuxt',
|
||||
'@vueuse/nuxt',
|
||||
'@ztl-uwu/nuxt-content',
|
||||
'@nuxt/image',
|
||||
'@nuxt/icon',
|
||||
'@nuxtjs/color-mode',
|
||||
'nuxt-og-image',
|
||||
'@nuxt/scripts',
|
||||
'@nuxtjs/i18n',
|
||||
'@nuxt/fonts'
|
||||
],
|
||||
components: {
|
||||
dirs: [
|
||||
{
|
||||
path: './components',
|
||||
ignore: ['**/*.ts']
|
||||
}
|
||||
]
|
||||
},
|
||||
devtools: { enabled: true },
|
||||
css: [
|
||||
join(currentDir, './assets/css/themes.css'),
|
||||
'~/assets/css/tailwind.css'
|
||||
],
|
||||
colorMode: {
|
||||
classSuffix: '',
|
||||
disableTransition: true
|
||||
},
|
||||
content: {
|
||||
documentDriven: true,
|
||||
highlight: {
|
||||
theme: {
|
||||
default: 'github-light',
|
||||
dark: 'github-dark'
|
||||
},
|
||||
preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'mdc', 'yaml', 'bash', 'ini', 'dotenv']
|
||||
},
|
||||
navigation: {
|
||||
fields: [
|
||||
'icon',
|
||||
'navBadges',
|
||||
'navTruncate',
|
||||
'badges',
|
||||
'toc',
|
||||
'sidebar',
|
||||
'collapse',
|
||||
'editLink',
|
||||
'prevNext',
|
||||
'breadcrumb',
|
||||
'fullpage'
|
||||
]
|
||||
},
|
||||
experimental: {
|
||||
search: {
|
||||
indexed: true
|
||||
}
|
||||
}
|
||||
},
|
||||
compatibilityDate: '2025-05-13',
|
||||
vite: {
|
||||
plugins: [
|
||||
tailwindcss()
|
||||
],
|
||||
optimizeDeps: {
|
||||
include: ['debug']
|
||||
}
|
||||
},
|
||||
typescript: {
|
||||
tsConfig: {
|
||||
compilerOptions: {
|
||||
baseUrl: '.'
|
||||
}
|
||||
}
|
||||
},
|
||||
fonts: {
|
||||
defaults: {
|
||||
weights: ['300 800']
|
||||
}
|
||||
},
|
||||
i18n: {
|
||||
bundle: {
|
||||
optimizeTranslationDirective: false
|
||||
},
|
||||
strategy: 'prefix_except_default'
|
||||
},
|
||||
icon: {
|
||||
clientBundle: {
|
||||
scan: true,
|
||||
sizeLimitKb: 512
|
||||
}
|
||||
},
|
||||
shadcn: {
|
||||
prefix: 'Ui',
|
||||
componentDir: join(currentDir, './components/ui')
|
||||
}
|
||||
})
|
1
.npmrc
1
.npmrc
@@ -1 +1,2 @@
|
||||
shamefully-hoist=true
|
||||
corepack-default-registry=https://registry.npmmirror.com
|
57
Dockerfile
57
Dockerfile
@@ -1,43 +1,38 @@
|
||||
########## 阶段 1:build ##########
|
||||
FROM node:20-alpine AS base
|
||||
# ------------- 依赖缓存阶段 -------------
|
||||
FROM node:22.16-alpine AS base
|
||||
|
||||
# 1. 如项目有原生包(better-sqlite3、sharp等)启用下面两行
|
||||
# RUN apk add --no-cache build-base python3 sqlite-dev
|
||||
# 国内镜像
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
|
||||
# 安装pnpm
|
||||
RUN npm install -g pnpm
|
||||
WORKDIR /app
|
||||
|
||||
WORKDIR /app
|
||||
# 1️⃣ 先把锁文件拷进来,让这一层可以 cache
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# 2. 用 pnpm 锁文件
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
# 2️⃣ 再执行安装
|
||||
RUN corepack enable && pnpm install --frozen-lockfile
|
||||
|
||||
# 3. 源码 + 打补丁
|
||||
COPY . .
|
||||
RUN chmod +x patch-ui-pro.zsh && ./patch-ui-pro.zsh
|
||||
# 3️⃣ 再拷剩余源码
|
||||
COPY . .
|
||||
RUN chmod +x patch-ui-pro.zsh && ./patch-ui-pro.zsh
|
||||
|
||||
# 4. 构建产物
|
||||
RUN pnpm build
|
||||
# ------------- 构建阶段 -------------
|
||||
FROM base AS builder
|
||||
RUN pnpm build
|
||||
|
||||
########## 阶段 2:生产运行时 ##########
|
||||
FROM node:20-alpine AS production
|
||||
# ------------- 运行阶段 -------------
|
||||
FROM node:22.16-alpine AS production
|
||||
|
||||
# 安装pnpm
|
||||
RUN npm install -g pnpm
|
||||
WORKDIR /app
|
||||
|
||||
# 输出里有 .output,Nuxt3 的默认路径
|
||||
WORKDIR /app
|
||||
# 拷贝 lock + package.json 用于安装 prod 依赖
|
||||
COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
|
||||
RUN corepack enable && pnpm install --frozen-lockfile --prod
|
||||
|
||||
# 1. 如果项目由 better-sqlite3,运行时还需 sqlite-libs
|
||||
# RUN apk add --no-cache sqlite-libs
|
||||
# 拷贝构建产物
|
||||
COPY --from=builder /app/.output ./.output
|
||||
|
||||
# 2. 只拷贝生产运行时
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile --prod
|
||||
EXPOSE 3000
|
||||
ENV NODE_ENV=production HOST=0.0.0.0 PORT=3000
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
|
||||
COPY --from=base /app/.output /app/.output
|
||||
|
||||
EXPOSE 3000
|
||||
ENV NODE_ENV=production HOST=0.0.0.0 PORT=3000
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
|
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@@ -38,9 +38,6 @@ importers:
|
||||
nuxt-og-image:
|
||||
specifier: ^5.1.9
|
||||
version: 5.1.9(@unhead/vue@2.0.12(vue@3.5.17(typescript@5.8.3)))(magicast@0.3.5)(unstorage@1.16.1(@netlify/blobs@9.1.2)(db0@0.3.2(better-sqlite3@12.2.0))(ioredis@5.6.1))(vite@7.0.6(@types/node@24.0.7)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))(vue@3.5.17(typescript@5.8.3))
|
||||
'{collection_name}':
|
||||
specifier: link:@iconify-json/{collection_name}
|
||||
version: link:@iconify-json/{collection_name}
|
||||
devDependencies:
|
||||
'@iconify-json/lucide':
|
||||
specifier: ^1.2.57
|
||||
|
Reference in New Issue
Block a user