Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files2 unmodified lines3456789103 unmodified lines1415161718192021222324253 unmodified lines29303132332 unmodified lines# Set the working directoryWORKDIR /app# Set STREAMLIT_HOME environment variable to a writable temporary directoryENV STREAMLIT_HOME="/tmp"# Install system dependenciesRUN apt-get update && apt-get install -y \3 unmodified linesgit \&& rm -rf /var/lib/apt/lists/*# Copy requirements.txt and install Python dependenciesCOPY requirements.txt ./RUN pip3 install -r requirements.txt# Copy your Streamlit application file to the working directory# Assuming your main app file is named app.py and is at the root level of your projectCOPY app.py ./# Expose the port Streamlit will run on3 unmodified linesHEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health# Define the entrypoint for the application# This runs the app.py scriptENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]2 unmodified lines34567891011123 unmodified lines161718192021222324252627282930313 unmodified lines353637382 unmodified lines# Set the working directoryWORKDIR /app# Set environment variables for Streamlit and Matplotlib cache directories# This directs Streamlit and Matplotlib to use the /tmp directory for cache/config filesENV STREAMLIT_HOME="/tmp"ENV MPLCONFIGDIR="/tmp"# Install system dependenciesRUN apt-get update && apt-get install -y \3 unmodified linesgit \&& rm -rf /var/lib/apt/lists/*# Upgrade pip and setuptools to ensure proper package installation and dependency resolutionRUN pip install --no-cache-dir --upgrade pip setuptools# Copy requirements.txt and install Python dependencies# Using --no-cache-dir to force fresh downloads and potentially rebuild wheels# This can help resolve binary incompatibility issues like the numpy.dtype errorCOPY requirements.txt ./RUN pip3 install --no-cache-dir -r requirements.txt# Copy your Streamlit application file to the working directoryCOPY app.py ./# Expose the port Streamlit will run on3 unmodified linesHEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health# Define the entrypoint for the applicationENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
Dockerfile+9-4