Severian commited on
Commit
069b336
·
verified ·
1 Parent(s): 7399363

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18-slim
2
+ WORKDIR /app
3
+
4
+ # Install dependencies first (for build cache efficiency)
5
+ COPY package*.json ./
6
+ # Install all dependencies including dev so Vite is available during build and preview
7
+ RUN npm install
8
+
9
+ # Copy the rest of the source code
10
+ COPY . .
11
+
12
+ # Ensure non-root user (UID 1000) can write to the app directory at runtime (HF Spaces runs with uid 1000)
13
+ RUN chown -R 1000:1000 /app
14
+
15
+ # Switch to the non-root user
16
+ USER 1000
17
+
18
+ # Default port for Hugging Face Spaces Docker runtime
19
+ ENV PORT 7860
20
+ EXPOSE 7860
21
+
22
+ # Start the app – this script builds then serves via Vite preview on $PORT
23
+ CMD ["npm", "start"]