NikhilJoson commited on
Commit
b40cad5
·
verified ·
1 Parent(s): a231c57

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # --- Stage 1: Build the React Frontend ---
2
+ FROM node:20-slim as builder
3
+
4
+ WORKDIR /app/frontend
5
+ COPY frontend/package.json frontend/package-lock.json* ./
6
+ RUN npm install
7
+ COPY frontend/ .
8
+ RUN npm run build
9
+
10
+ # --- Stage 2: Create the Python Application ---
11
+ FROM python:3.10-slim
12
+
13
+ WORKDIR /app
14
+
15
+ # Install Python dependencies for the proxy
16
+ COPY proxy_backend/requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy the built frontend from the builder stage
20
+ COPY --from=builder /app/frontend/dist ./static
21
+
22
+ # Copy the proxy backend code
23
+ COPY proxy_backend/ ./proxy_backend
24
+
25
+ # Expose the default Hugging Face port
26
+ EXPOSE 7860
27
+
28
+ # Command to run the proxy server application on the correct port
29
+ CMD ["uvicorn", "proxy_backend.main:app", "--host", "0.0.0.0", "--port", "7860"]