File size: 896 Bytes
2e24d5b
 
 
 
 
 
 
 
 
 
 
 
 
9cbd08e
 
2e24d5b
9cbd08e
7ce4b9e
 
9cbd08e
 
d91725a
9cbd08e
6d255dd
 
 
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
# Use Python 3.11 as the base image
FROM python:3.11

# Set the working directory inside the container
WORKDIR /app

# Copy all project files into the container
COPY . /app

# Install dependencies
RUN pip install --upgrade pip
RUN pip install -r requirement.txt

# Expose the required port (Hugging Face Spaces uses 7860)
EXPOSE 7860

# Ensure logs directory exists
RUN mkdir -p /app/logs && chmod -R 777 /app/logs

# Install tmux to run multiple processes
RUN apt-get update && apt-get install -y tmux

# Start FastAPI & Streamlit together using tmux
# CMD ["sh", "-c", "tmux new-session -d -s fastapi 'uvicorn backend.main:app --host 0.0.0.0 --port 7860' && streamlit run Frontend/app.py --server.port 7860 --server.address 0.0.0.0"]

CMD ["sh", "-c", "uvicorn backend.main:app --host 0.0.0.0 --port 8000 & sleep 5 && streamlit run Frontend/app.py --server.port 7860 --server.address 0.0.0.0"]