Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
-
FROM python:3.10-slim-bullseye
|
3 |
|
4 |
# Set environment variables for Python, pip, and locale
|
5 |
ENV PYTHONUNBUFFERED 1
|
@@ -11,14 +11,19 @@ ENV LANG C.UTF-8
|
|
11 |
ENV LC_ALL C.UTF-8
|
12 |
|
13 |
# Install system dependencies (as root)
|
|
|
|
|
14 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
15 |
ffmpeg \
|
16 |
imagemagick \
|
17 |
git \
|
|
|
|
|
18 |
fonts-dejavu-core \
|
19 |
fonts-liberation \
|
20 |
libgl1-mesa-glx \
|
21 |
libglib2.0-0 \
|
|
|
22 |
&& rm -rf /var/lib/apt/lists/*
|
23 |
|
24 |
# Modify ImageMagick policy.xml (as root)
|
@@ -52,9 +57,7 @@ RUN groupadd -r appgroup --gid 1000 && \
|
|
52 |
|
53 |
# Set Streamlit home directory (already created and chowned)
|
54 |
ENV STREAMLIT_HOME=/home/appuser/.streamlit
|
55 |
-
|
56 |
-
# ENV STREAMLIT_CLIENT_GATHER_USAGE_STATS=false # This was incorrect, use browser.gatherUsageStats
|
57 |
-
ENV BROWSER_GATHERUSAGEDATA=false # Alternative environment variable for the same thing
|
58 |
|
59 |
# Set the working directory in the container
|
60 |
WORKDIR /app
|
@@ -65,7 +68,10 @@ COPY --chown=appuser:appgroup requirements.txt .
|
|
65 |
# Install Python dependencies as the non-root user
|
66 |
USER appuser
|
67 |
RUN pip install --no-cache-dir --upgrade pip && \
|
68 |
-
|
|
|
|
|
|
|
69 |
|
70 |
# Add user's local bin to PATH
|
71 |
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
@@ -86,5 +92,4 @@ RUN mkdir -p /app/assets/fonts
|
|
86 |
EXPOSE 8501
|
87 |
|
88 |
# Define the command to run the application
|
89 |
-
# CORRECTED --client.gatherUsageStats to --browser.gatherUsageStats
|
90 |
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"]
|
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.10-slim-bullseye # Using -slim, not -slim-bullseye for broader compatibility initially
|
3 |
|
4 |
# Set environment variables for Python, pip, and locale
|
5 |
ENV PYTHONUNBUFFERED 1
|
|
|
11 |
ENV LC_ALL C.UTF-8
|
12 |
|
13 |
# Install system dependencies (as root)
|
14 |
+
# Added build-essential for packages that might need to compile C code
|
15 |
+
# Added libffi-dev (often needed by cryptography, a common sub-dependency)
|
16 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
17 |
ffmpeg \
|
18 |
imagemagick \
|
19 |
git \
|
20 |
+
build-essential \
|
21 |
+
libffi-dev \
|
22 |
fonts-dejavu-core \
|
23 |
fonts-liberation \
|
24 |
libgl1-mesa-glx \
|
25 |
libglib2.0-0 \
|
26 |
+
curl \
|
27 |
&& rm -rf /var/lib/apt/lists/*
|
28 |
|
29 |
# Modify ImageMagick policy.xml (as root)
|
|
|
57 |
|
58 |
# Set Streamlit home directory (already created and chowned)
|
59 |
ENV STREAMLIT_HOME=/home/appuser/.streamlit
|
60 |
+
ENV BROWSER_GATHERUSAGEDATA=false
|
|
|
|
|
61 |
|
62 |
# Set the working directory in the container
|
63 |
WORKDIR /app
|
|
|
68 |
# Install Python dependencies as the non-root user
|
69 |
USER appuser
|
70 |
RUN pip install --no-cache-dir --upgrade pip && \
|
71 |
+
echo "Attempting to install packages from requirements.txt" && \
|
72 |
+
pip install --user --no-cache-dir -r requirements.txt && \
|
73 |
+
echo "Attempting to install streamlit-sortable from GitHub" && \
|
74 |
+
pip install --user --no-cache-dir git+https://github.com/okld/streamlit-sortable.git
|
75 |
|
76 |
# Add user's local bin to PATH
|
77 |
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
|
|
92 |
EXPOSE 8501
|
93 |
|
94 |
# Define the command to run the application
|
|
|
95 |
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"]
|