static id

This commit is contained in:
hamid zarghami
2025-04-16 12:26:28 +03:30
parent d87925998f
commit 5e5f02ee06
4 changed files with 4007 additions and 17 deletions
+5 -4
View File
@@ -4,20 +4,21 @@ RUN apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && \ cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && \
echo "Asia/Tehran" > /etc/timezone echo "Asia/Tehran" > /etc/timezone
RUN npm install -g corepack
# RUN corepack enable && corepack prepare pnpm@latest --activate RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app WORKDIR /app
FROM base AS deps FROM base AS deps
RUN apk add --no-cache libc6-compat git RUN apk add --no-cache libc6-compat git
COPY package*.json ./ COPY package*.json ./
RUN npm ci --ignore-scripts --loglevel info COPY pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts
FROM base AS builder FROM base AS builder
WORKDIR /build WORKDIR /build
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
RUN npm run build && npm ci --omit=dev --ignore-scripts --loglevel info RUN pnpm build && pnpm install --prod --frozen-lockfile --ignore-scripts
FROM base AS runner FROM base AS runner
WORKDIR /app WORKDIR /app
+2 -3
View File
@@ -35,9 +35,8 @@
"@types/react-dom": "^19", "@types/react-dom": "^19",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "15.2.3", "eslint-config-next": "15.2.3",
"i": "^0.3.7",
"npm": "^11.3.0",
"tailwindcss": "^4", "tailwindcss": "^4",
"typescript": "^5" "typescript": "^5"
} },
"packageManager": "pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531"
} }
+3990
View File
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -5,20 +5,20 @@ import { NextPage } from 'next'
import SingleBlogPage from '../components/SingleBlogPage' import SingleBlogPage from '../components/SingleBlogPage'
import Loading from './loading' import Loading from './loading'
interface PageProps { // interface PageProps {
params: Promise<{ // params: Promise<{
id: string // id: string
}> // }>
} // }
const SingleBlog: NextPage<PageProps> = async ({ params }) => { const SingleBlog: NextPage = async () => {
const { id } = await params // const { id } = await params
console.log("loading", id); // console.log("loading", id);
return ( return (
<Suspense fallback={<Loading />}> <Suspense fallback={<Loading />}>
<BlogContent id={id} /> <BlogContent id={'7539fa00-e8e0-4b2b-a4b5-655284b5e8a1'} />
</Suspense> </Suspense>
) )
} }
@@ -28,7 +28,7 @@ async function BlogContent({ id }: { id: string }) {
const queryClient = new QueryClient() const queryClient = new QueryClient()
await Promise.all([ await Promise.all([
queryClient.prefetchQuery(blogSingleQueryOptions(id)), queryClient.prefetchQuery(blogSingleQueryOptions('7539fa00-e8e0-4b2b-a4b5-655284b5e8a1')),
// queryClient.prefetchQuery(mostVisitedBlogsQueryOptions) // queryClient.prefetchQuery(mostVisitedBlogsQueryOptions)
]) ])