File size: 1,109 Bytes
b754693 0f454b6 b754693 538e792 be56043 0f454b6 b754693 0f454b6 b754693 20c6701 0f454b6 be56043 97d502a 331b12f be56043 20a357d 331b12f 0f454b6 538e792 be56043 0f454b6 be56043 0f454b6 20c6701 0f454b6 538e792 7644799 20a357d 7644799 0f454b6 23209af | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | FROM debian:bookworm-slim
USER root
RUN apt-get update && apt-get install -y curl unzip ca-certificates && rm -rf /var/lib/apt/lists/*
# Install Bun to a global path instead of /root/.bun
ENV BUN_INSTALL=/usr/local/bun
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/usr/local/bun/bin:$PATH"
RUN bun --version
# Copy ffmpeg
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/
RUN ffmpeg -version
# Create HF Spaces runtime user
RUN useradd -m -u 1000 user
# Pre-create /data with open permissions
# RUN mkdir -p /data && chmod -R 777 /data
WORKDIR /app
COPY --chown=user package.json ./
RUN bun install --production
# Switch to runtime user — Bun is now in PATH because /usr/local/bun/bin is world-accessible
USER user
ENV PATH="/usr/local/bun/bin:/usr/local/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
ENV STORAGE_ROOT="/tmp"
COPY --chown=user . .
EXPOSE 7860
CMD ["bun", "run", "start:prod:tsdown"] |