Chittrarasu commited on
Commit
9cbd08e
·
1 Parent(s): 7ce4b9e

code changes

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -11,14 +11,14 @@ COPY . /app
11
  RUN pip install --upgrade pip
12
  RUN pip install -r requirement.txt
13
 
14
- # Expose ports for FastAPI (8000) and Streamlit (8501)
15
- EXPOSE 8000
16
- EXPOSE 8501
17
 
18
- # Ensure logs directory exists and has correct permissions
19
  RUN mkdir -p /app/logs && chmod -R 777 /app/logs
20
 
21
- # Start both FastAPI and Streamlit when the container runs
22
- CMD ["sh", "-c", "uvicorn backend.main:app --host 0.0.0.0 --port 8000 & streamlit run Frontend/app.py --server.port 8501 --server.address 0.0.0.0"]
23
-
24
 
 
 
 
11
  RUN pip install --upgrade pip
12
  RUN pip install -r requirement.txt
13
 
14
+ # Expose the required port (Hugging Face Spaces uses 7860)
15
+ EXPOSE 7860
 
16
 
17
+ # Ensure logs directory exists
18
  RUN mkdir -p /app/logs && chmod -R 777 /app/logs
19
 
20
+ # Install tmux to run multiple processes
21
+ RUN apt-get update && apt-get install -y tmux
 
22
 
23
+ # Start FastAPI & Streamlit together using tmux
24
+ 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"]