Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +32 -28
Dockerfile
CHANGED
|
@@ -1,44 +1,48 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
# Use an official Python image
|
| 22 |
-
FROM python:3.10
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
RUN
|
| 35 |
-
COPY .streamlit/config.toml /root/.streamlit/config.toml
|
| 36 |
|
| 37 |
-
#
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
# Run the Streamlit app from the src folder
|
| 41 |
-
CMD ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 42 |
|
| 43 |
|
| 44 |
|
|
|
|
| 1 |
+
# Use official Python base image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set workdir to /src
|
| 5 |
+
WORKDIR /src
|
| 6 |
|
| 7 |
+
# Copy requirements and install dependencies
|
| 8 |
+
COPY requirements.txt /src/
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Create the .streamlit config directory and copy config.toml
|
| 12 |
+
RUN mkdir -p /root/.streamlit
|
| 13 |
+
COPY .streamlit/config.toml /root/.streamlit/config.toml
|
| 14 |
|
| 15 |
+
# Copy entire src directory contents into container
|
| 16 |
+
COPY src/ /src/
|
| 17 |
|
| 18 |
+
# Expose streamlit port
|
| 19 |
+
EXPOSE 8501
|
| 20 |
|
| 21 |
+
# Command to run your app
|
| 22 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 23 |
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
# # Use an official Python image
|
| 26 |
+
# FROM python:3.10
|
| 27 |
|
| 28 |
+
# # Set the working directory
|
| 29 |
+
# WORKDIR /app
|
| 30 |
|
| 31 |
+
# # Copy all files to the container
|
| 32 |
+
# COPY . /app
|
| 33 |
|
| 34 |
+
# # Install dependencies
|
| 35 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 36 |
|
| 37 |
+
# # Create the .streamlit config directory and copy config.toml
|
| 38 |
+
# RUN mkdir -p /root/.streamlit
|
| 39 |
+
# COPY .streamlit/config.toml /root/.streamlit/config.toml
|
| 40 |
+
|
| 41 |
+
# # Expose port 8501 for Streamlit
|
| 42 |
+
# EXPOSE 8501
|
| 43 |
|
| 44 |
+
# # Run the Streamlit app from the src folder
|
| 45 |
+
# CMD ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 46 |
|
| 47 |
|
| 48 |
|