TorchLLM commited on
Commit
de0fb90
·
verified ·
1 Parent(s): 11b9e66

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -6
Dockerfile CHANGED
@@ -1,8 +1,29 @@
1
- # Set the working directory (optional)
2
- WORKDIR /src
3
 
4
- # Display current working directory
5
- RUN pwd
6
 
7
- # # Copy files from source to destination
8
- # COPY <src-path> <destination-path>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.10 as the base image
2
+ FROM python:3.10-slim
3
 
4
+ # Set the working directory in the container
5
+ WORKDIR /app/src
6
 
7
+ # Copy the `requirements.txt` file from `src` directory
8
+ COPY src/requirements.txt ./requirements.txt
9
+
10
+ # Install Python dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Copy the entire `src` directory to the container
14
+ COPY src .
15
+
16
+ # Expose ports for the FastAPI and Streamlit apps
17
+ EXPOSE 8000 8501
18
+
19
+ # Create a script to run both the FastAPI and Streamlit apps
20
+ RUN echo '#!/bin/bash\n\
21
+ python response_api.py &\n\
22
+ sleep 5\n\
23
+ streamlit run app.py' > ./start.sh
24
+
25
+ # Make the script executable
26
+ RUN chmod +x ./start.sh
27
+
28
+ # Run the startup script
29
+ CMD ["./start.sh"]