dpv007 commited on
Commit
e3a0aff
·
verified ·
1 Parent(s): 2da55fa

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python as the base image to support heavy AI libraries
2
+ FROM python:3.11-slim
3
+
4
+ # Install system dependencies and Node.js 20
5
+ RUN apt-get update && apt-get install -y curl \
6
+ && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
7
+ && apt-get install -y nodejs \
8
+ && apt-get clean \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Set the working directory
12
+ WORKDIR /app
13
+
14
+ # 1. Setup Backend
15
+ COPY backend/requirements.txt ./backend/
16
+ RUN pip install --no-cache-dir -r backend/requirements.txt
17
+
18
+ # 2. Setup Frontend
19
+ COPY frontend/package*.json ./frontend/
20
+ RUN cd frontend && npm install
21
+
22
+ # 3. Copy the rest of the application code
23
+ COPY . .
24
+
25
+ # 4. Build the Next.js application
26
+ RUN cd frontend && npm run build
27
+
28
+ # 5. Make the startup script executable
29
+ RUN chmod +x /app/start.sh
30
+
31
+ # Hugging Face Spaces strictly requires port 7860
32
+ EXPOSE 7860
33
+
34
+ # Run the startup script
35
+ CMD ["/app/start.sh"]