Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -18
Dockerfile
CHANGED
|
@@ -18,30 +18,26 @@
|
|
| 18 |
# CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 19 |
|
| 20 |
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
-
# Copy
|
| 26 |
-
COPY
|
| 27 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
-
|
| 29 |
-
# Copy all source code
|
| 30 |
-
COPY src/ /src/
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
RUN
|
| 34 |
|
| 35 |
-
#
|
| 36 |
-
RUN
|
| 37 |
-
|
| 38 |
-
headless = true\n\
|
| 39 |
-
port = 8501\n\
|
| 40 |
-
enableCORS = false\n\
|
| 41 |
-
\n\
|
| 42 |
-
" > /src/.streamlit/config.toml
|
| 43 |
|
|
|
|
| 44 |
EXPOSE 8501
|
| 45 |
|
|
|
|
| 46 |
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 47 |
|
|
|
|
|
|
| 18 |
# CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 19 |
|
| 20 |
|
| 21 |
+
# Use an official Python image
|
| 22 |
+
FROM python:3.10
|
| 23 |
|
| 24 |
+
# Set the working directory
|
| 25 |
+
WORKDIR /app
|
| 26 |
|
| 27 |
+
# Copy all files to the container
|
| 28 |
+
COPY . /app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
# Install dependencies
|
| 31 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 32 |
|
| 33 |
+
# Create the .streamlit config directory and copy config.toml
|
| 34 |
+
RUN mkdir -p /root/.streamlit
|
| 35 |
+
COPY .streamlit/config.toml /root/.streamlit/config.toml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
# Expose port 8501 for Streamlit
|
| 38 |
EXPOSE 8501
|
| 39 |
|
| 40 |
+
# Run the Streamlit app
|
| 41 |
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 42 |
|
| 43 |
+
|