Spaces:
Paused
Paused
Update Dockerfile
Browse files1 unmodified line23456787 unmodified lines1617181920212223242526272829306 unmodified lines373839404142434445464748495051525354555657585960611 unmodified lineFROM node:21.0-alpine AS depsWORKDIR /app# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.RUN apk add --no-cache libc6-compatCOPY package.json yarn.lock ./7 unmodified linesCOPY . .RUN yarn build# Production image, copy all the files and run nextFROM node:21.0-alpine AS runnerWORKDIR /appENV SITE_NAME="Web-SyncPlay"ENV PUBLIC_DOMAIN="https://web-syncplay.de"ENV REDIS_URL="redis://redis:6379"EXPOSE 3000LABEL org.opencontainers.image.url="https://web-syncplay.de" \org.opencontainers.image.description="Watch videos or play music in sync with your friends" \6 unmodified linescurl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \chmod a+rx /usr/local/bin/yt-dlp# You only need to copy next.config.js if you are NOT using the default configuration# COPY --from=builder /app/next.config.js ./COPY --from=builder /app/public ./publicCOPY --from=builder /app/package.json ./package.json# Automatically leverage output traces to reduce image size# https://nextjs.org/docs/advanced-features/output-file-tracingCOPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/staticUSER nextjsEXPOSE 8081ENV PORT 8081# Next.js collects completely anonymous telemetry data about general usage.# Learn more here: https://nextjs.org/telemetry# Uncomment the following line in case you want to disable telemetry.# ENV NEXT_TELEMETRY_DISABLED 1CMD ["sh", "-c", "node server.js"]1 unmodified line23456787 unmodified lines16171819202122232425262728293031323334356 unmodified lines424344454647484950515253541 unmodified lineFROM node:21.0-alpine AS depsWORKDIR /app# libc6-compat helps some native depsRUN apk add --no-cache libc6-compatCOPY package.json yarn.lock ./7 unmodified linesCOPY . .RUN yarn build# Production image, copy all the files and run Next.jsFROM node:21.0-alpine AS runnerWORKDIR /app# Default envs (override in Space settings)ENV SITE_NAME="Web-SyncPlay"# Set this in Space settings to your Space URL, e.g. https://your-username-web-syncplay.hf.spaceENV PUBLIC_DOMAIN="https://web-syncplay.de"# Use a managed Redis URL (e.g. Upstash) set in Space settingsENV REDIS_URL="redis://redis:6379"# Hugging Face Spaces expects your app to listen on $PORT (default 7860)ENV PORT=7860EXPOSE 7860LABEL org.opencontainers.image.url="https://web-syncplay.de" \org.opencontainers.image.description="Watch videos or play music in sync with your friends" \6 unmodified linescurl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \chmod a+rx /usr/local/bin/yt-dlp# Static assets and standalone outputCOPY --from=builder /app/public ./publicCOPY --from=builder /app/package.json ./package.jsonCOPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/staticUSER nextjs# Next.js will pick up PORT env varCMD ["sh", "-c", "node server.js"]
Dockerfile+11-18