victor HF staff commited on
Commit
5f34e64
1 Parent(s): 89c3c02

feat: Run server and Streamlit app in Docker container

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -4
  2. start.sh +3 -0
Dockerfile CHANGED
@@ -19,8 +19,8 @@ RUN pip install --no-cache-dir -r requirements.txt
19
  # Install PyAudio
20
  RUN pip install PyAudio==0.2.14
21
 
22
- # Make port 7860 available to the world outside this container
23
- EXPOSE 7860
24
 
25
  # Set environment variable for API_URL
26
  ENV API_URL=http://0.0.0.0:60808/chat
@@ -28,5 +28,8 @@ ENV API_URL=http://0.0.0.0:60808/chat
28
  # Set PYTHONPATH
29
  ENV PYTHONPATH=./
30
 
31
- # Run streamlit when the container launches
32
- CMD ["streamlit", "run", "webui/omni_streamlit.py", "--server.port", "7860"]
 
 
 
 
19
  # Install PyAudio
20
  RUN pip install PyAudio==0.2.14
21
 
22
+ # Make ports 7860 and 60808 available to the world outside this container
23
+ EXPOSE 7860 60808
24
 
25
  # Set environment variable for API_URL
26
  ENV API_URL=http://0.0.0.0:60808/chat
 
28
  # Set PYTHONPATH
29
  ENV PYTHONPATH=./
30
 
31
+ # Make start.sh executable
32
+ RUN chmod +x start.sh
33
+
34
+ # Run start.sh when the container launches
35
+ CMD ["./start.sh"]
start.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #!/bin/bash
2
+ python3 server.py --ip '0.0.0.0' --port 60808 &
3
+ streamlit run webui/omni_streamlit.py --server.port 7860