Update Dockerfile
Browse files- Dockerfile +18 -16
Dockerfile
CHANGED
@@ -1,30 +1,32 @@
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
# Install system dependencies
|
|
|
7 |
RUN apt-get update && apt-get install -y \
|
8 |
build-essential \
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
-
# Copy requirements
|
15 |
-
COPY requirements.txt .
|
16 |
|
17 |
-
# Install Python dependencies
|
18 |
-
RUN pip install --no-cache-dir
|
|
|
19 |
|
20 |
-
# Copy the application code
|
21 |
COPY . .
|
22 |
|
23 |
-
# Expose the port that Streamlit
|
24 |
EXPOSE 7860
|
25 |
|
26 |
-
#
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
1 |
+
# Use a slim Python base image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install system dependencies needed by RDKit and other libraries *before* anything else.
|
8 |
+
# This ensures required libraries like libXrender are available.
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
build-essential \
|
11 |
+
libxrender1 \
|
12 |
+
libfontconfig1 \
|
13 |
+
libxext6 \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
+
# Copy the requirements file into the container
|
17 |
+
COPY requirements.txt ./requirements.txt
|
18 |
|
19 |
+
# Install the Python dependencies
|
20 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
21 |
+
pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
+
# Copy the rest of your application's code into the container
|
24 |
COPY . .
|
25 |
|
26 |
+
# Expose the port that Streamlit will run on (Hugging Face default is 7860)
|
27 |
EXPOSE 7860
|
28 |
|
29 |
+
# Command to run the Streamlit app
|
30 |
+
# - Add --server.gatherUsageStats=false to prevent the permission error.
|
31 |
+
# - The --server.headless=true flag is recommended for containerized environments.
|
32 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.headless=true", "--server.gatherUsageStats=false"]
|
|