diff --git a/Dockerfile b/Dockerfile index 02d915c1a..8576fbc54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,19 +10,19 @@ COPY --from=deps /app/node_modules ./node_modules COPY . . ENV NEXT_TELEMETRY_DISABLED=1 ENV CI=true -RUN bun run build +RUN --mount=type=cache,target=/app/.next/cache bun run build FROM node:20-slim AS runner WORKDIR /app ENV NODE_ENV=production -ENV PORT=8080 -EXPOSE 8080 +ENV PORT=3000 +EXPOSE 3000 # 关键:确保复制了所有必要的文件,特别是 drizzle 文件夹 COPY --from=builder /app/public ./public -COPY --from=builder /app/.next ./.next -COPY --from=builder /app/node_modules ./node_modules -COPY --from=builder /app/package.json ./package.json -COPY --from=builder /app/drizzle ./drizzle +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/drizzle ./drizzle +COPY --from=builder /app/VERSION ./VERSION -CMD ["node", "node_modules/.bin/next", "start"] +CMD ["node", "server.js"] diff --git a/docker-compose.yaml b/docker-compose.yaml index ba4e98241..743440556 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -68,7 +68,13 @@ services: - "${APP_PORT:-23000}:3000" restart: unless-stopped healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:3000/api/actions/health || exit 1"] + test: + [ + "CMD", + "node", + "-e", + "fetch('http://' + (process.env.HOSTNAME || '127.0.0.1') + ':3000/api/actions/health').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))", + ] interval: 30s timeout: 5s retries: 3 diff --git a/drizzle/0062_aromatic_taskmaster.sql b/drizzle/0062_aromatic_taskmaster.sql index dc6dd60b5..57861fa78 100644 --- a/drizzle/0062_aromatic_taskmaster.sql +++ b/drizzle/0062_aromatic_taskmaster.sql @@ -1 +1 @@ -ALTER TABLE "providers" ADD COLUMN "gemini_google_search_preference" varchar(20); \ No newline at end of file +ALTER TABLE "providers" ADD COLUMN IF NOT EXISTS "gemini_google_search_preference" varchar(20);