Compare commits

..

2 Commits

Author SHA1 Message Date
Umar Adilov
537ed60fa8 Added support for deleting all cache data 2025-05-10 18:14:48 +05:00
Umar Adilov
edb39d5538 Optimized on docker build 2025-05-10 18:07:11 +05:00
2 changed files with 13 additions and 7 deletions

View File

@ -7,10 +7,18 @@ RUN corepack enable && corepack prepare pnpm@latest --activate
ENV CI=true
WORKDIR /app
# Copy package.json and pnpm-lock.yaml first for caching
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install
# Copy the rest of the files
COPY . .
# Install dependencies and build
RUN pnpm install && pnpm build
# Build the application
RUN pnpm build
FROM node:18-alpine AS runner

View File

@ -1,16 +1,14 @@
import { revalidateTag } from 'next/cache';
import { revalidatePath } from 'next/cache';
import { NextResponse } from 'next/server';
import { FetchTags } from '@/shared/api/tags';
export async function GET() {
try {
revalidateTag(FetchTags.TAYLOR);
revalidatePath('*'); // Drop all cache
return NextResponse.json({ success: true });
} catch (err) {
return NextResponse.json(
{ error: 'Failed to revalidate', detail: err },
{ error: 'Failed to drop cache', detail: err },
{ status: 500 },
);
}