File size: 1,309 Bytes
ffbb6f0
fd0ee34
a878e43
1ea6780
a878e43
 
1ea6780
a878e43
125f18f
a830538
1ea6780
 
ffbb6f0
a830538
8efa104
1182309
 
 
db88c10
ffbb6f0
a830538
db88c10
ffae513
8f01dac
ffae513
8f01dac
a830538
ffbb6f0
 
a830538
db88c10
 
 
a830538
 
5a69576
 
 
1182309
a830538
 
 
db88c10
 
ffbb6f0
 
 
db88c10
b419751
e3156f8
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
47
48
49
50
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"]