CoolFace
Apppublic

hugging-science/science-release-map

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
42likes
Dockerfile53 linesDownload Raw Back to root
1# syntax=docker/dockerfile:1.42 3FROM oven/bun:1 AS base4 5# Install dependencies only when needed6FROM base AS deps7WORKDIR /app8 9# Install dependencies based on the preferred package manager10COPY --link package.json bun.lockb* ./11RUN bun install12 13# Rebuild the source code only when needed14FROM base AS builder15WORKDIR /app16COPY --from=deps --link /app/node_modules ./node_modules17COPY --link  . .18 19# Next.js collects completely anonymous telemetry data about general usage.20# Uncomment the following line in case you want to disable telemetry during the build.21# ENV NEXT_TELEMETRY_DISABLED 122 23RUN bun run build24 25# Production image, copy all the files and run next26FROM base AS runner27WORKDIR /app28 29ENV NODE_ENV production30# Uncomment the following line in case you want to disable telemetry during runtime.31# ENV NEXT_TELEMETRY_DISABLED 132 33RUN apt-get update \34  && apt-get install -y --no-install-recommends adduser \35  && rm -rf /var/lib/apt/lists/*36 37RUN \38    addgroup --system --gid 1001 nodejs; \39    adduser --system --uid 1001 nextjs40 41COPY --from=builder --link /app/public ./public42 43# Automatically leverage output traces to reduce image size44COPY --from=builder --link --chown=1001:1001 /app/.next/standalone ./45COPY --from=builder --link --chown=1001:1001 /app/.next/static ./.next/static46 47USER nextjs48 49EXPOSE 300050 51ENV PORT 300052ENV HOSTNAME 0.0.0.053CMD ["bun", "run", "server.js"]