Alasil1 commited on
Commit ·
d42f069
1
Parent(s): 15f6f5c
Add .streamlit folder and secrets
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
# The base image for the application.
|
| 2 |
FROM docker.io/library/python:3.13.5-slim@sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419
|
| 3 |
|
| 4 |
# Install build dependencies and Git.
|
|
@@ -11,20 +10,21 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
# Set the working directory inside the container.
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
# This
|
| 16 |
-
|
| 17 |
|
| 18 |
-
# Copy the
|
| 19 |
-
COPY requirements.txt
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
|
| 25 |
# Expose port 8501 for Streamlit.
|
| 26 |
EXPOSE 8501
|
| 27 |
|
| 28 |
# The command to run the Streamlit application.
|
| 29 |
-
# It uses the file that is located in the `src` subdirectory.
|
| 30 |
CMD ["streamlit", "run", "src/app.py"]
|
|
|
|
|
|
|
| 1 |
FROM docker.io/library/python:3.13.5-slim@sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419
|
| 2 |
|
| 3 |
# Install build dependencies and Git.
|
|
|
|
| 10 |
# Set the working directory inside the container.
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
+
# Create the .streamlit directory and copy the secrets.toml file from the host.
|
| 14 |
+
# This approach avoids permission issues and ensures the folder exists.
|
| 15 |
+
RUN mkdir /.streamlit
|
| 16 |
|
| 17 |
+
# Copy the Streamlit configuration files directly into the created directory.
|
| 18 |
+
COPY requirements.txt .
|
| 19 |
+
COPY src/app.py src/
|
| 20 |
+
COPY .streamlit/secrets.toml /.streamlit/secrets.toml
|
| 21 |
+
COPY .streamlit/config.toml /.streamlit/config.toml
|
| 22 |
|
| 23 |
+
# Install Python dependencies.
|
| 24 |
+
RUN pip install -r requirements.txt
|
| 25 |
|
| 26 |
# Expose port 8501 for Streamlit.
|
| 27 |
EXPOSE 8501
|
| 28 |
|
| 29 |
# The command to run the Streamlit application.
|
|
|
|
| 30 |
CMD ["streamlit", "run", "src/app.py"]
|