davidepanza commited on
Commit
9b716e1
·
verified ·
1 Parent(s): 2d3ef4b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -1
Dockerfile CHANGED
@@ -1,11 +1,38 @@
1
  FROM node:18
2
 
 
 
 
3
  WORKDIR /app
 
 
4
  COPY package*.json ./
5
  RUN npm install
 
 
6
  COPY . .
 
 
7
  RUN npm run build
8
 
 
9
  RUN npm install -g serve
 
 
 
 
 
 
 
 
 
 
 
 
10
  EXPOSE 7860
11
- CMD ["serve", "-s", "dist", "-l", "7860"]
 
 
 
 
 
 
1
  FROM node:18
2
 
3
+ # Install Python and pip
4
+ RUN apt-get update && apt-get install -y python3 python3-pip python3-venv
5
+
6
  WORKDIR /app
7
+
8
+ # Copy and install Node.js dependencies
9
  COPY package*.json ./
10
  RUN npm install
11
+
12
+ # Copy React app source
13
  COPY . .
14
+
15
+ # Build React app
16
  RUN npm run build
17
 
18
+ # Install serve globally
19
  RUN npm install -g serve
20
+
21
+ # Create Python virtual environment and install FastAPI dependencies
22
+ RUN python3 -m venv /app/venv
23
+ ENV PATH="/app/venv/bin:$PATH"
24
+
25
+ # Copy Python requirements and install
26
+ COPY requirements.txt .
27
+ RUN pip install --no-cache-dir -r requirements.txt
28
+
29
+ # Copy FastAPI proxy server
30
+ COPY proxy_server.py .
31
+
32
  EXPOSE 7860
33
+
34
+ # Copy the startup script
35
+ COPY start.sh .
36
+ RUN chmod +x start.sh
37
+
38
+ CMD ["./start.sh"]