Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +26 -13
Dockerfile
CHANGED
@@ -1,26 +1,39 @@
|
|
1 |
|
2 |
-
|
|
|
3 |
|
|
|
4 |
WORKDIR /app
|
5 |
|
|
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
build-essential \
|
8 |
curl \
|
9 |
-
software-properties-common \
|
10 |
git \
|
|
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
-
|
14 |
-
COPY
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
EXPOSE 8501
|
23 |
|
24 |
-
|
25 |
-
|
26 |
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
1 |
|
2 |
+
# Use a full Python base image (better compatibility with TensorFlow and OpenCV)
|
3 |
+
FROM python:3.9
|
4 |
|
5 |
+
# Set the working directory in the container
|
6 |
WORKDIR /app
|
7 |
|
8 |
+
# Install system dependencies
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
build-essential \
|
11 |
curl \
|
|
|
12 |
git \
|
13 |
+
libgl1-mesa-glx \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
+
# Copy all project files into the container
|
17 |
+
COPY . .
|
18 |
+
|
19 |
+
# Create .streamlit config directory and disable usage stats (prevent permission issues)
|
20 |
+
RUN mkdir -p /app/.streamlit && \
|
21 |
+
echo "\
|
22 |
+
[server]\n\
|
23 |
+
headless = true\n\
|
24 |
+
enableCORS = false\n\
|
25 |
+
port = 8501\n\
|
26 |
+
\n\
|
27 |
+
[browser]\n\
|
28 |
+
gatherUsageStats = false\n\
|
29 |
+
" > /app/.streamlit/config.toml
|
30 |
+
|
31 |
+
# Install Python dependencies
|
32 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
33 |
+
|
34 |
+
# Expose Streamlit port
|
35 |
EXPOSE 8501
|
36 |
|
37 |
+
# Start the Streamlit app
|
|
|
38 |
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
39 |
+
|