Spaces:
deepak191z
/
Runtime error

File size: 1,127 Bytes
928cb17
e5e68b3
7fc72b1
7510967
7fc72b1
 
 
 
d99f0d7
928cb17
 
0cdf744
928cb17
 
b5794f9
928cb17
 
7510967
928cb17
 
b29824e
62cc76b
 
 
928cb17
 
d99f0d7
928cb17
 
b5794f9
7fc72b1
 
48b5ca6
d67390e
 
 
 
62cc76b
 
 
 
 
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
FROM node:20

RUN npm install -g pnpm

# Hugging Face uses port 7860 by default
EXPOSE 7860
ENV PORT 7860
ENV HOSTNAME "0.0.0.0"

# Create a non-root user
RUN useradd -m appuser

# Set the working directory
WORKDIR /home/appuser/react-video-editor

# Clone the code repository
RUN git clone https://github.com/designcombo/react-video-editor.git .

# Change ownership of the entire project directory
RUN chown -R appuser:appuser /home/appuser/react-video-editor

# Set correct permissions for the project directory
RUN chmod -R 755 /home/appuser/react-video-editor

# Switch to the non-root user
USER appuser

# Install dependencies
RUN pnpm install

# Build the application
RUN pnpm run build

# Ensure the user has write permissions in the necessary directories
RUN mkdir -p /home/appuser/react-video-editor/.vite && \
    chmod 755 /home/appuser/react-video-editor/.vite

# Give write permissions to the node_modules directory
RUN chmod -R 755 /home/appuser/react-video-editor/node_modules

# Start the application with more verbose logging
CMD ["sh", "-c", "ls -la && pnpm run preview -- --host 0.0.0.0 --port 7860 --debug"]