Chittrarasu commited on
Commit
56531d1
·
1 Parent(s): 4a3521a

backend deploymemt

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -12
Dockerfile CHANGED
@@ -8,20 +8,14 @@ WORKDIR /app
8
  COPY . /app
9
 
10
  # Install dependencies
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 8000
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"]
25
 
26
- # 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"]
27
  CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
8
  COPY . /app
9
 
10
  # Install dependencies
11
+ RUN pip install --upgrade pip
12
  RUN pip install -r requirement.txt
13
 
14
+ # Set PYTHONPATH so FastAPI can find the 'backend' module
15
+ ENV PYTHONPATH=/app
 
 
 
16
 
17
+ # Expose the required port
18
+ EXPOSE 8000
 
 
 
19
 
20
+ # Start FastAPI with the correct module path
21
  CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]