Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -8,18 +8,19 @@ WORKDIR /app
|
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
# Install the Python dependencies
|
| 11 |
-
# Using --no-cache-dir to save space
|
| 12 |
-
# Using find . -type d -name "__pycache__" -exec rm -rf {} +; to clean up __pycache__
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt && \
|
| 14 |
find . -type d -name "__pycache__" -exec rm -rf {} +;
|
| 15 |
|
| 16 |
-
# Copy the Streamlit application file into the container
|
| 17 |
COPY app.py .
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Expose the port Streamlit runs on (default for Hugging Face Spaces is 7860)
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
# Define the
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false", "--server.address", "0.0.0.0", "--server.headless", "true"]
|
|
|
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
# Install the Python dependencies
|
|
|
|
|
|
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt && \
|
| 12 |
find . -type d -name "__pycache__" -exec rm -rf {} +;
|
| 13 |
|
| 14 |
+
# Copy the Streamlit application file and the entrypoint script into the container
|
| 15 |
COPY app.py .
|
| 16 |
+
COPY entrypoint.sh .
|
| 17 |
+
|
| 18 |
+
# Give execution rights to the entrypoint script
|
| 19 |
+
RUN chmod +x entrypoint.sh
|
| 20 |
|
| 21 |
# Expose the port Streamlit runs on (default for Hugging Face Spaces is 7860)
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
+
# Define the entrypoint for the container
|
| 25 |
+
# This will execute the entrypoint.sh script when the container starts
|
| 26 |
+
ENTRYPOINT ["./entrypoint.sh"]
|
|
|