diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fb3fcdf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +.git +.next +node_modules +data +refs/*.pdf +refs/*.docx +refs/*.jpg +refs/*.jpeg +refs/*.png +.env +.env.local +.env.production +.memory +.playwright-mcp +ui-*.png +*.log +.DS_Store +.vscode +.idea diff --git a/.memory/worklog.json b/.memory/worklog.json index e9d1d92..65d5e46 100644 --- a/.memory/worklog.json +++ b/.memory/worklog.json @@ -313,6 +313,39 @@ "message": "auto-save 2026-05-19 08:51 (~2)", "hash": "b76bbdf", "files_changed": 2 + }, + { + "ts": "2026-05-19T08:57:17+08:00", + "type": "commit", + "message": "auto-save 2026-05-19 08:57 (~3)", + "hash": "91520fd", + "files_changed": 3 + }, + { + "ts": "2026-05-19T08:58:43+08:00", + "type": "commit", + "message": "chore: configure personal model environment", + "hash": "12e3b97", + "files_changed": 0 + }, + { + "ts": "2026-05-19T00:59:58Z", + "type": "session-heartbeat", + "message": "Codex 会话活跃 · 最近命令:codex · 分支 master · 1 项未提交变更 · 最近提交:chore: configure personal model environment", + "files_changed": 1 + }, + { + "ts": "2026-05-19T09:07:59+08:00", + "type": "commit", + "message": "fix: align model provider configuration", + "hash": "ffa6b2e", + "files_changed": 7 + }, + { + "ts": "2026-05-19T01:09:59Z", + "type": "session-heartbeat", + "message": "Codex 会话活跃 · 最近命令:codex · 分支 master · 1 项未提交变更 · 最近提交:fix: align model provider configuration", + "files_changed": 1 } ] } diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bd9a7b6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM node:22-alpine AS deps +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --legacy-peer-deps + +FROM node:22-alpine AS builder +WORKDIR /app +ENV NEXT_TELEMETRY_DISABLED=1 +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN mkdir -p public +RUN npm run build +RUN npm prune --omit=dev --legacy-peer-deps + +FROM node:22-alpine AS runner +WORKDIR /app +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 +ENV PORT=4560 +RUN addgroup -S nextjs -g 1001 && adduser -S nextjs -u 1001 +COPY --from=builder --chown=nextjs:nextjs /app/package.json /app/package-lock.json ./ +COPY --from=builder --chown=nextjs:nextjs /app/node_modules ./node_modules +COPY --from=builder --chown=nextjs:nextjs /app/.next ./.next +COPY --from=builder --chown=nextjs:nextjs /app/public ./public +RUN mkdir -p data && chown -R nextjs:nextjs data +USER nextjs +EXPOSE 4560 +HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 CMD node -e "fetch('http://127.0.0.1:4560').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" +CMD ["npm", "run", "start"] diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..2b92758 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,39 @@ +name: ai-toy-patent-workflow + +services: + web: + container_name: ai-toy-patent-workflow + build: + context: . + dockerfile: Dockerfile + image: ai-toy-patent-workflow:latest + restart: unless-stopped + env_file: + - ./deploy/.env.production + environment: + NODE_ENV: production + PORT: "4560" + volumes: + - ./data:/app/data + networks: + - coolify + labels: + traefik.enable: "true" + traefik.docker.network: coolify + traefik.http.middlewares.ai-toy-patent-gzip.compress: "true" + traefik.http.middlewares.ai-toy-patent-redirect.redirectscheme.scheme: https + traefik.http.routers.ai-toy-patent-http.entryPoints: http + traefik.http.routers.ai-toy-patent-http.middlewares: ai-toy-patent-redirect + traefik.http.routers.ai-toy-patent-http.rule: Host(`ai-toy.kang-kang.com`) + traefik.http.routers.ai-toy-patent-http.service: ai-toy-patent + traefik.http.routers.ai-toy-patent-https.entryPoints: https + traefik.http.routers.ai-toy-patent-https.middlewares: ai-toy-patent-gzip + traefik.http.routers.ai-toy-patent-https.rule: Host(`ai-toy.kang-kang.com`) + traefik.http.routers.ai-toy-patent-https.service: ai-toy-patent + traefik.http.routers.ai-toy-patent-https.tls: "true" + traefik.http.routers.ai-toy-patent-https.tls.certresolver: letsencrypt + traefik.http.services.ai-toy-patent.loadbalancer.server.port: "4560" + +networks: + coolify: + external: true diff --git a/src/app/page.tsx b/src/app/page.tsx index 98f2515..0b68e1f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -199,7 +199,7 @@ export default function Home() {
批量出意向 · 快筛 · 锁定角色 · 一键四包 · Seedance 视频