Spaces:
deepak191z
/
Runtime error

deepak191z commited on
Commit
7fc72b1
·
verified ·
1 Parent(s): 928cb17

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -9
Dockerfile CHANGED
@@ -1,10 +1,11 @@
1
  FROM node:20
2
- RUN npm install -g pnpm
3
 
4
- EXPOSE 3000
5
 
6
- ENV PORT 3000
7
- ENV HOSTNAME 0.0.0.0
 
 
8
 
9
  # Create a non-root user
10
  RUN useradd -m appuser
@@ -21,13 +22,11 @@ RUN chown -R appuser:appuser /home/appuser/react-video-editor
21
  # Switch to the non-root user
22
  USER appuser
23
 
24
- # Install pnpm
25
-
26
  # Install dependencies
27
  RUN pnpm install
28
 
29
- # Set permissions for the working directory
30
- RUN chmod -R 777 /home/appuser/react-video-editor
31
 
32
  # Start the application
33
- CMD ["pnpm", "run", "dev", "--", "--host"]
 
1
  FROM node:20
 
2
 
3
+ RUN npm install -g pnpm
4
 
5
+ # Hugging Face uses port 7860 by default
6
+ EXPOSE 7860
7
+ ENV PORT 7860
8
+ ENV HOSTNAME "0.0.0.0"
9
 
10
  # Create a non-root user
11
  RUN useradd -m appuser
 
22
  # Switch to the non-root user
23
  USER appuser
24
 
 
 
25
  # Install dependencies
26
  RUN pnpm install
27
 
28
+ # Build the application
29
+ RUN pnpm run build
30
 
31
  # Start the application
32
+ CMD ["pnpm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "7860"]