diamond-in commited on
Commit
748342b
·
verified ·
1 Parent(s): f256740

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a base image that makes it easy to install multiple tools
2
+ FROM node:20-slim
3
+
4
+ # 1. Install Python (and pip if needed)
5
+ RUN apt-get update && apt-get install -y \
6
+ python3 \
7
+ python3-pip \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # 2. Set working directory
11
+ WORKDIR /app
12
+
13
+ # 3. Copy dependencies first (caching)
14
+ COPY package.json package-lock.json* ./
15
+ RUN npm install
16
+
17
+ # 4. Copy the rest of the app
18
+ COPY . .
19
+
20
+ # 5. Build the Next.js app
21
+ RUN npm run build
22
+
23
+ # 6. Expose the port (HF Spaces uses 7860)
24
+ EXPOSE 7860
25
+ ENV PORT=7860
26
+ ENV HOSTNAME="0.0.0.0"
27
+
28
+ # 7. Run the Next.js server
29
+ CMD ["npm", "start"]