FROM oven/bun:latest USER root RUN apt-get update # RUN apt-get upgrade -y # RUN apt-get install -y ffmpeg RUN rm -rf /var/lib/apt/lists/* # COPY --from=mwader/static-ffmpeg:latest --chmod=755 /ffmpeg /usr/local/bin/ # COPY --from=mwader/static-ffmpeg:latest --chmod=755 /ffprobe /usr/local/bin/ COPY --from=mwader/static-ffmpeg:6.1.1 --chmod=755 /ffmpeg /usr/local/bin/ COPY --from=mwader/static-ffmpeg:6.1.1 --chmod=755 /ffprobe /usr/local/bin/ # # ADD THE CHMOD HERE # RUN chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe RUN ffmpeg -version # FIX: Rename the image's pre-existing UID 1000 user ('bun') to 'user' # This avoids the "UID is not unique" build crash. RUN usermod -l user bun && groupmod -n user bun && usermod -d /home/user -m user WORKDIR /app COPY --chown=user package.json ./ RUN bun install --production USER user ENV PATH="/home/user/.bun/bin:$PATH" ENV FFMPEG_V="6.1.1" ENV FFPROBE_V="6.1.1" ENV NODE_TLS_REJECT_UNAUTHORIZED="0" ENV NODE_ENV=production ENV CPU_0V1=1 COPY --chown=user . . USER root RUN mkdir -p /data && chown -R user:user /data && chmod -R 777 /data EXPOSE 7860 USER user CMD ["bun", "run", "start:prod:tsdown"]