FROM node:20 # Set up a new user named "user" with user ID 1000 RUN useradd -o -u 1000 user # Switch to the "user" user USER user # Set home to the user's home directory ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ USER_SITE=$HOME/app # Create working directory that matches HF Spaces expectations WORKDIR $HOME/app # Clone your repository (replace with your actual repo URL) # RUN git clone https://huggingface.co/spaces/DeFactOfficial/MMAPI-2 . #RUN git pull # Copy the current directory contents into the container at $HOME/app setting the owner to the user ADD . $HOME/app COPY --chown=user . $HOME/app # INSTALL NPM PACKAGES # INSTALL FFMPEG TOOLING # FIRE UP API # Loading Dependencies RUN npm install #RUN $HOME/app/ffmpeg_install.sh # Expose application's default port EXPOSE 7860 # Start all services in background with logging #cd /app/service1 && ./run.sh > /var/log/service1.log 2>&1 & #cd /app/service2 && ./run.sh > /var/log/service2.log 2>&1 & #cd /app/service3 && ./run.sh > /var/log/service3.log 2>&1 & # Start the API ENTRYPOINT ["node", "./api.js"]