Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files123456789101112131415FROM node:20-slimWORKDIR /appCOPY package.json ./RUN npm install --omit=devCOPY app.js ./# HF Spaces expects the app to listen on 7860 by default (see app_port# in README.md's Space metadata below).ENV PORT=7860EXPOSE 7860CMD ["node", "app.js"]1234567891011121314151617181920212223242526272829303132333435363738# FROM node:22.16.0FROM oven/bun:1.3.4# Install ffmpeg# RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*# Create a non-root user withRUN useradd -m -u 2000 userUSER userENV PATH="/home/user/.local/bin:$PATH"# Set working directoryWORKDIR /app# COPY --chown=user bun.lockb bun.lockbCOPY --chown=user package.json package.jsonRUN bun install# Copy package files and install dependencies#COPY --chown=user package*.json ./# RUN npm install# Copy the rest of the application sourceCOPY --chown=user . /app# Expose the port if needed (optional, depending on the hosting environment)EXPOSE 7860EXPOSE 8000EXPOSE 8080# Run the Node.js application# CMD ["node", "app.js"]CMD ["bun", "app.js"]
Dockerfile+31-8