muskan19 commited on
Commit
f3975e1
·
verified ·
1 Parent(s): 9df6aa5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -1
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  # Should print 200
2
-
3
  # Use a full Python base image (better compatibility with TensorFlow and OpenCV)
4
  FROM python:3.9
5
  import requests
@@ -40,4 +40,47 @@ EXPOSE 8501
40
 
41
  # Start the Streamlit app
42
  ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
 
1
  # Should print 200
2
+ '''
3
  # Use a full Python base image (better compatibility with TensorFlow and OpenCV)
4
  FROM python:3.9
5
  import requests
 
40
 
41
  # Start the Streamlit app
42
  ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
43
+ '''
44
+
45
+ # Use a full Python base image for compatibility
46
+ FROM python:3.9
47
+
48
+ # Set the working directory in the container
49
+ WORKDIR /app
50
+
51
+ # Install system dependencies
52
+ RUN apt-get update && apt-get install -y \
53
+ build-essential \
54
+ curl \
55
+ git \
56
+ libgl1-mesa-glx \
57
+ && rm -rf /var/lib/apt/lists/*
58
+
59
+ # ✅ Internet connectivity test to Hugging Face
60
+ RUN curl -I https://huggingface.co
61
+
62
+ # Copy all project files into the container
63
+ COPY . .
64
+
65
+ # Create .streamlit config directory and disable usage stats
66
+ RUN mkdir -p /app/.streamlit && \
67
+ echo "\
68
+ [server]\n\
69
+ headless = true\n\
70
+ enableCORS = false\n\
71
+ port = 8501\n\
72
+ \n\
73
+ [browser]\n\
74
+ gatherUsageStats = false\n\
75
+ " > /app/.streamlit/config.toml
76
+
77
+ # Install Python dependencies
78
+ RUN pip install --no-cache-dir -r requirements.txt
79
+
80
+ # Expose Streamlit default port
81
+ EXPOSE 8501
82
+
83
+ # Start the Streamlit app
84
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
85
+
86