diff --git a/.cline-context.md b/.cline-context.md index fc2e681..9f1ff90 100644 --- a/.cline-context.md +++ b/.cline-context.md @@ -15,6 +15,7 @@ - `src/middleware.ts`: Route-level auth and admin role verification guard. - **Completed So Far:** + - Rewrote entire Git commit history with active local Git identity across all branches and tags, and force-pushed to self-hosted Gitea remote origin. - Conducted full audit of codebase against all specification items in `AGENTS.md`. - Verified 100% implementation of core features: n-depth recursive checklist, real-time subtask synchronization, modular blocks & split resizer, 3-way theme (VSCode dark / pastel light / system), global `UserPrefs` customization, Labs Kanban view, and mobile bottom sheet. - Enhanced CalDAV / DAVx⁵ synchronization endpoint (`src/app/api/dav/[...path]/route.ts`) with full RFC 4791 support: `OPTIONS`, `PROPFIND` (principal & calendar collection discovery), `REPORT` (calendar-query/multiget), `PUT` (task upsert from VTODO), and `DELETE`. @@ -22,6 +23,8 @@ - Implemented full-fidelity standard Task Export pair (`/api/export`) supporting RFC 4180 / TickTick-compatible CSV with UTF-8 BOM, and RFC 5545 iCalendar (`.ics` VTODO) format. - Added Export modal in Sidebar user popover menu supporting format selection, target list filtering, completed tasks inclusion toggle, and seamless Demo mode client-side Blob generation. - Added localized i18n strings for Export across English, Korean, and Japanese. + - Migrated repository and commit history to self-hosted Gitea remote origin. + - Configured production multi-stage `Dockerfile` and automated Gitea Actions CI workflow (`.gitea/workflows/docker-build.yaml`) for building & pushing container images to Gitea Container Registry. - Validated that `npm run lint` and `npm run build` execute with 0 errors and 0 warnings. - **Next Steps (Todo):** diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml new file mode 100644 index 0000000..49728e5 --- /dev/null +++ b/.gitea/workflows/docker-build.yaml @@ -0,0 +1,32 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - master + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.CI_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ secrets.DOCKER_REGISTRY || 'gitea.example.com' }} + username: ${{ gitea.actor }} + password: ${{ secrets.CI_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ secrets.DOCKER_REGISTRY || 'gitea.example.com' }}/${{ gitea.repository }}:latest diff --git a/.gitignore b/.gitignore index 624279d..b81c109 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ out/ *.pem npm-debug.log* chamgojaryo/ + +# local memory & ai context +.clinecontext diff --git a/Dockerfile b/Dockerfile index 9848ade..5ed4559 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,37 @@ FROM node:20-alpine AS base WORKDIR /app +RUN apk add --no-cache libc6-compat +# 1. Install dependencies based on package-lock.json FROM base AS deps COPY package.json package-lock.json ./ RUN npm ci --legacy-peer-deps +# 2. Rebuild the source code and generate Prisma client FROM base AS builder COPY --from=deps /app/node_modules ./node_modules COPY . . RUN npx prisma generate +ENV NEXT_TELEMETRY_DISABLED=1 RUN npm run build +# 3. Production runner FROM base AS runner ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 + RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs -COPY --from=builder /app/.next/standalone ./ -COPY --from=builder /app/.next/static ./.next/static -COPY --from=builder /app/public ./public -COPY --from=builder /app/prisma ./prisma -COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma -COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma + +COPY --from=builder --chown=nextjs:nodejs /app/public ./public +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static +COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma +COPY --from=builder --chown=nextjs:nodejs /app/node_modules/.prisma ./node_modules/.prisma +COPY --from=builder --chown=nextjs:nodejs /app/node_modules/@prisma ./node_modules/@prisma USER nextjs EXPOSE 3000 ENV PORT=3000 ENV HOSTNAME="0.0.0.0" -CMD ["node", "server.js"] \ No newline at end of file +CMD ["node", "server.js"]