TorchLLM commited on
Commit
db7efc1
·
verified ·
1 Parent(s): d76057f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -14
Dockerfile CHANGED
@@ -1,25 +1,22 @@
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
- # Debug: Print the current working directory and list the files
8
- RUN echo "Debugging the source directory during build context:" && pwd && ls -R /
9
 
10
- # Copy requirements.txt from the source directory to /app/src
11
- COPY ./src/requirements.txt /app/src/requirements.txt
12
 
13
- # Install Python dependencies
14
- RUN pip install --no-cache-dir -r /app/src/requirements.txt
15
 
16
- # Copy the source code to the container
17
- COPY . .
18
-
19
- # Expose ports for FastAPI and Streamlit apps
20
  EXPOSE 8000 8501
21
 
22
- # Create a script to run both FastAPI and Streamlit apps
23
  RUN echo '#!/bin/bash\n\
24
  python response_api.py &\n\
25
  sleep 5\n\
@@ -28,5 +25,8 @@ streamlit run app.py' > ./start.sh
28
  # Make the script executable
29
  RUN chmod +x ./start.sh
30
 
31
- # Run the startup script
 
 
 
32
  CMD ["./start.sh"]
 
1
+ # Use Python 3.10 as base image
2
  FROM python:3.10-slim
3
 
4
+ # Set working directory in container
5
  WORKDIR /app/src
6
 
7
+ # Copy requirements file
8
+ COPY src/requirements.txt .
9
 
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Copy the entire project
14
+ COPY src .
15
 
16
+ # Expose ports for API and Streamlit
 
 
 
17
  EXPOSE 8000 8501
18
 
19
+ # Create script to run both services
20
  RUN echo '#!/bin/bash\n\
21
  python response_api.py &\n\
22
  sleep 5\n\
 
25
  # Make the script executable
26
  RUN chmod +x ./start.sh
27
 
28
+ # Copy .env file and set environment variables
29
+ ENV $(cat .env | xargs)
30
+
31
+ # Run the start script
32
  CMD ["./start.sh"]