Update Dockerfile
Browse files- Dockerfile +23 -23
Dockerfile
CHANGED
|
@@ -1,38 +1,38 @@
|
|
| 1 |
# Use Python 3.10 as the base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
WORKDIR /app/src
|
| 6 |
|
| 7 |
-
# Debug: List directory
|
| 8 |
RUN ls -R /
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
| 36 |
|
| 37 |
-
#
|
| 38 |
-
|
|
|
|
| 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: List all files in the root directory of the build context
|
| 8 |
RUN ls -R /
|
| 9 |
|
| 10 |
+
# Copy the `requirements.txt` file from the `src` directory
|
| 11 |
+
COPY src/requirements.txt /app/src/requirements.txt
|
| 12 |
|
| 13 |
+
# Debug: List contents of `/app/src` after copying requirements.txt
|
| 14 |
+
RUN ls -R /app/src
|
| 15 |
|
| 16 |
+
# Install Python dependencies
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
+
# Copy the entire `src` directory to the container
|
| 20 |
+
COPY src /app/src
|
| 21 |
|
| 22 |
+
# Debug: Confirm the contents of `/app/src` after copying all files
|
| 23 |
+
RUN ls -R /app/src
|
| 24 |
|
| 25 |
+
# Expose necessary ports
|
| 26 |
+
EXPOSE 8000 8501
|
| 27 |
|
| 28 |
+
# Create a script to run both the FastAPI and Streamlit apps
|
| 29 |
+
RUN echo '#!/bin/bash\n\
|
| 30 |
+
python response_api.py &\n\
|
| 31 |
+
sleep 5\n\
|
| 32 |
+
streamlit run app.py' > ./start.sh
|
| 33 |
|
| 34 |
+
# Make the script executable
|
| 35 |
+
RUN chmod +x ./start.sh
|
| 36 |
|
| 37 |
+
# Run the script
|
| 38 |
+
CMD ["./start.sh"]
|