KamalamSivakumar commited on
Commit
40d3002
·
verified ·
1 Parent(s): 0c028ff

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -6
Dockerfile CHANGED
@@ -1,10 +1,33 @@
1
- FROM python:3.10-slim
2
 
3
- WORKDIR /app
4
- COPY . /app
5
 
6
- RUN pip install --upgrade pip
7
- RUN pip install -r requirements.txt
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  EXPOSE 7860
10
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
1
+ # FROM python:3.10-slim
2
 
3
+ # WORKDIR /app
4
+ # COPY . /app
5
 
6
+ # RUN pip install --upgrade pip
7
+ # RUN pip install -r requirements.txt
8
 
9
+ # EXPOSE 7860
10
+ # CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
11
+
12
+ FROM python:3.10
13
+
14
+ # Set up working directory
15
+ WORKDIR /code
16
+
17
+ # Install dependencies
18
+ COPY requirements.txt .
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Copy app code
22
+ COPY . .
23
+
24
+ # Expose default Streamlit port
25
  EXPOSE 7860
26
+
27
+ # Install tmux to run both apps
28
+ RUN apt-get update && apt-get install -y tmux
29
+
30
+ # Run FastAPI backend and Streamlit frontend together
31
+ CMD tmux new-session -d "uvicorn app:app --host 0.0.0.0 --port 7861" \; \
32
+ new-window -n streamlit "streamlit run streamlit_app.py --server.port 7860 --server.enableCORS false" \; \
33
+ attach