CoolFace
Apppublic

subrajeet/object-detection

sourceHugging Faceupdated 3y agoView on Hugging Face
1likes
Dockerfile65 linesDownload Raw Back to root
1FROM node:18 AS base2 3# Install dependencies only when needed4FROM base AS deps5WORKDIR /app6 7# Install dependencies based on the preferred package manager8COPY --link package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./9RUN npm config set registry http://registry.npmjs.org/10RUN \11    if [ -f yarn.lock ]; then yarn --frozen-lockfile; \12    elif [ -f package-lock.json ]; then npm ci; \13    elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \14    else echo "Lockfile not found." && exit 1; \15    fi16 17 18# Rebuild the source code only when needed19FROM base AS builder20WORKDIR /app21COPY --from=deps --link /app/node_modules ./node_modules22COPY --link  . .23 24# Next.js collects completely anonymous telemetry data about general usage.25# Learn more here: https://nextjs.org/telemetry26# Uncomment the following line in case you want to disable telemetry during the build.27# ENV NEXT_TELEMETRY_DISABLED 128 29ENV UPLOADTHING_SECRET=sk_live_5a90f295fe50e167faee22fe02e212ffba43a525533c5a5202605fd8c046c5ac30ENV UPLOADTHING_APP_ID=7kao66kypm31 32RUN npm run build33 34# Production image, copy all the files and run next35FROM base AS runner36WORKDIR /app37# Uncomment the following line in case you want to disable telemetry during runtime.38# ENV NEXT_TELEMETRY_DISABLED 139 40RUN \41    addgroup --system --gid 1001 nodejs; \42    adduser --system --uid 1001 nextjs43 44COPY --from=builder --link /app/public ./public45 46# Automatically leverage output traces to reduce image size47# https://nextjs.org/docs/advanced-features/output-file-tracing48COPY --from=builder --link --chown=1001:1001 /app/.next/standalone ./49COPY --from=builder --link --chown=1001:1001 /app/.next/static ./.next/static50 51USER nextjs52 53EXPOSE 300054ENV PORT 300055# ENV HOSTNAME localhost56ENV NODE_ENV=production57ENV UPLOADTHING_SECRET=sk_live_5a90f295fe50e167faee22fe02e212ffba43a525533c5a5202605fd8c046c5ac58ENV UPLOADTHING_APP_ID=7kao66kypm59 60# Allow the running process to write model files to the cache folder.61# NOTE: In practice, you would probably want to pre-download the model files to avoid having to download them on-the-fly.62RUN mkdir -p /app/node_modules/@xenova/.cache/63RUN chmod 777 -R /app/node_modules/@xenova/64 65CMD ["node", "server.js"]