Update Dockerfile
Browse files- Dockerfile +12 -4
Dockerfile
CHANGED
|
@@ -68,7 +68,7 @@ FROM python:3.10-slim
|
|
| 68 |
|
| 69 |
WORKDIR /usr/src/app
|
| 70 |
|
| 71 |
-
#
|
| 72 |
RUN apt-get update && \
|
| 73 |
apt-get install -y git && \
|
| 74 |
rm -rf /var/lib/apt/lists/*
|
|
@@ -76,14 +76,22 @@ RUN apt-get update && \
|
|
| 76 |
# Copy the entire fixed private_repo folder from the builder stage.
|
| 77 |
COPY --from=builder /build/private_repo/ /usr/src/app/
|
| 78 |
|
| 79 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
RUN echo "Contents of /usr/src/app:" && ls -la /usr/src/app
|
| 81 |
|
| 82 |
-
# Expose
|
| 83 |
EXPOSE 8501
|
| 84 |
|
| 85 |
# Set the working directory to where st_app.py is located.
|
| 86 |
WORKDIR /usr/src/app
|
| 87 |
|
| 88 |
# Start the Streamlit app.
|
| 89 |
-
CMD ["streamlit", "run", "st_app.py", "--server.headless", "true", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false", "--server.fileWatcherType", "none"]
|
|
|
|
| 68 |
|
| 69 |
WORKDIR /usr/src/app
|
| 70 |
|
| 71 |
+
# Install git (if needed) and any system dependencies.
|
| 72 |
RUN apt-get update && \
|
| 73 |
apt-get install -y git && \
|
| 74 |
rm -rf /var/lib/apt/lists/*
|
|
|
|
| 76 |
# Copy the entire fixed private_repo folder from the builder stage.
|
| 77 |
COPY --from=builder /build/private_repo/ /usr/src/app/
|
| 78 |
|
| 79 |
+
# Reinstall Python dependencies in the final stage.
|
| 80 |
+
# This ensures that streamlit (and all other dependencies) are installed.
|
| 81 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 82 |
+
|
| 83 |
+
# (Optional) Reinstall custom packages if they are not already installed.
|
| 84 |
+
# For example, if your custom packages are not on PyPI, you might need to install them here.
|
| 85 |
+
# You can also run any additional installation steps if needed.
|
| 86 |
+
|
| 87 |
+
# Debug: List contents to verify that st_app.py and other files are present.
|
| 88 |
RUN echo "Contents of /usr/src/app:" && ls -la /usr/src/app
|
| 89 |
|
| 90 |
+
# Expose Streamlit's default port.
|
| 91 |
EXPOSE 8501
|
| 92 |
|
| 93 |
# Set the working directory to where st_app.py is located.
|
| 94 |
WORKDIR /usr/src/app
|
| 95 |
|
| 96 |
# Start the Streamlit app.
|
| 97 |
+
CMD ["streamlit", "run", "st_app.py", "--server.headless", "true", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false", "--server.fileWatcherType", "none"]
|