File size: 767 Bytes
40d3002
809c6e1
40d3002
 
809c6e1
40d3002
 
809c6e1
40d3002
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
809c6e1
40d3002
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# FROM python:3.10-slim

# WORKDIR /app
# COPY . /app

# RUN pip install --upgrade pip
# RUN pip install -r requirements.txt

# EXPOSE 7860
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]

FROM python:3.10

# Set up working directory
WORKDIR /code

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy app code
COPY . .

# Expose default Streamlit port
EXPOSE 7860

# Install tmux to run both apps
RUN apt-get update && apt-get install -y tmux

# Run FastAPI backend and Streamlit frontend together
CMD tmux new-session -d "uvicorn app:app --host 0.0.0.0 --port 7861" \; \
    new-window -n streamlit "streamlit run streamlit_app.py --server.port 7860 --server.enableCORS false" \; \
    attach