alidenewade commited on
Commit
c04ccf7
·
verified ·
1 Parent(s): 116273d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 command to run the Streamlit application
23
- # Added --server.address 0.0.0.0 to ensure it's accessible within the container environment
24
- # Added --server.headless true for running in server-only environments like Hugging Face Spaces
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"]