From 6485b245f6197b8e3a578a0bb4f1e8eda0d2692d Mon Sep 17 00:00:00 2001 From: gunshiz Date: Tue, 7 Jul 2026 19:33:43 +0700 Subject: [PATCH] fix(linktree&backend): correct path, split work docker --- Dockerfile | 29 +++++++++++++++++++++++++---- app/page.tsx | 4 ++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 786922e..8ec11da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,30 @@ -FROM oven/bun:latest - +# Stage 1: Install dependencies +FROM oven/bun:alpine AS deps WORKDIR /app -COPY package.json ./ -RUN bun install +# Copy only package files to leverage Docker layer caching +COPY package.json bun.lock ./ +# Install dependencies +RUN bun install --frozen-lockfile + +# Stage 2: Build the application +FROM oven/bun:alpine AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules COPY . . +# Build Next.js RUN bun run build + +# Stage 3: Production runner +FROM oven/bun:alpine AS runner +WORKDIR /app +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 + +# Copy built assets and dependencies from builder stage +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 + EXPOSE 3000 CMD ["bun", "start"] \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index 8088bd5..172c0ec 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -53,8 +53,8 @@ export default async function Home() { dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />