Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
|
@@ -4,19 +4,22 @@ FROM python:3.10-slim
|
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /app/src
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Install Python dependencies
|
| 11 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy the source code
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
-
# Expose ports for
|
| 17 |
EXPOSE 8000 8501
|
| 18 |
|
| 19 |
-
# Create a script to run both
|
| 20 |
RUN echo '#!/bin/bash\n\
|
| 21 |
python response_api.py &\n\
|
| 22 |
sleep 5\n\
|
|
@@ -26,4 +29,4 @@ streamlit run app.py' > ./start.sh
|
|
| 26 |
RUN chmod +x ./start.sh
|
| 27 |
|
| 28 |
# Run the startup script
|
| 29 |
-
CMD ["./start.sh"]
|
|
|
|
| 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\
|
|
|
|
| 29 |
RUN chmod +x ./start.sh
|
| 30 |
|
| 31 |
# Run the startup script
|
| 32 |
+
CMD ["./start.sh"]
|