mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-07-14 18:15:56 -04:00
- Delete filterable-row, backup-schedule, integrations, and system-health atom files; replace with useState/useTransition + server action calls - Replace /api/explore/discover route with discoverByGenre server action; refactor FilterableTitleRow to call it directly via useTransition - Wrap PagesLayout and AuthLayout children in Suspense to fix dynamic rendering errors during PPR static generation; remove StoreProvider - Sequence ExplorePage session fetch before TMDB calls to prevent build-time requests during static generation - Drop unnecessary "use client" directives from dashboard and person components that have no client-side hooks or browser API usage - Improve Dockerfile: add bun install layer cache mount, copy .next/cache from builder, reorder ENV declarations
63 lines
1.4 KiB
Docker
63 lines
1.4 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM oven/bun:1-alpine AS base
|
|
|
|
# --- Dependencies ---
|
|
FROM base AS deps
|
|
WORKDIR /app
|
|
|
|
COPY package.json bun.lock ./
|
|
|
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
bun install --no-save --frozen-lockfile
|
|
|
|
# --- Builder ---
|
|
FROM base AS builder
|
|
WORKDIR /app
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
ARG APP_VERSION
|
|
ARG GIT_COMMIT_SHA
|
|
ENV NODE_ENV=production
|
|
ENV APP_VERSION=${APP_VERSION}
|
|
ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
RUN bun run build
|
|
|
|
# --- Runner ---
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
|
|
ARG APP_VERSION
|
|
ARG GIT_COMMIT_SHA
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
ENV HOSTNAME=0.0.0.0
|
|
ENV DATA_DIR=/data
|
|
ENV APP_VERSION=${APP_VERSION}
|
|
ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
COPY --from=builder --chown=bun:bun /app/public ./public
|
|
|
|
RUN mkdir .next \
|
|
&& chown bun:bun .next
|
|
|
|
COPY --from=builder --chown=bun:bun /app/.next/standalone ./
|
|
COPY --from=builder --chown=bun:bun /app/.next/static ./.next/static
|
|
COPY --from=builder --chown=bun:bun /app/.next/cache ./.next/cache
|
|
COPY --from=builder --chown=bun:bun /app/drizzle ./drizzle
|
|
|
|
RUN mkdir -p /data \
|
|
&& chown bun:bun /data
|
|
|
|
USER bun
|
|
EXPOSE 3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
|
CMD ["bun", "-e", "fetch('http://localhost:3000/api/health').then(r => process.exit(+!r.ok)).catch(() => process.exit(1))"]
|
|
|
|
CMD ["bun", "server.js"]
|