Spaces:
Running
Running
| 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 | |
| ENV PATH="$HOME/app/ffmpeg-7.0.2-amd64-static:$PATH" | |
| # 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 wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | |
| RUN unxz ./ffmpeg-release-amd64-static.tar.xz | |
| RUN tar -xvf ./ffmpeg-release-amd64-static.tar | |
| # 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"] |