Update Dockerfile
Browse files- Dockerfile +18 -3
Dockerfile
CHANGED
@@ -1,21 +1,35 @@
|
|
1 |
FROM python:3.9-slim
|
2 |
|
|
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
build-essential \
|
8 |
curl \
|
9 |
git \
|
|
|
|
|
|
|
|
|
|
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
# Upgrade pip
|
13 |
RUN pip install --upgrade pip
|
14 |
|
15 |
-
# Install PyTorch first to avoid torch-scatter
|
16 |
RUN pip install torch==2.1.2
|
17 |
|
18 |
-
#
|
|
|
|
|
|
|
19 |
COPY requirements.txt ./
|
20 |
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
|
@@ -25,4 +39,5 @@ COPY src/ ./src/
|
|
25 |
# Expose port and define entrypoint
|
26 |
EXPOSE 8501
|
27 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
|
|
28 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
+
# Set the working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Install system dependencies required by RDKit and Streamlit
|
7 |
RUN apt-get update && apt-get install -y \
|
8 |
build-essential \
|
9 |
curl \
|
10 |
git \
|
11 |
+
libxrender1 \
|
12 |
+
libglib2.0-0 \
|
13 |
+
libsm6 \
|
14 |
+
libxext6 \
|
15 |
+
libx11-6 \
|
16 |
&& rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
+
# Set Streamlit environment variables to avoid permission issues
|
19 |
+
ENV STREAMLIT_HOME="/app/.streamlit"
|
20 |
+
ENV STREAMLIT_BROWSER_GATHERUSAGESTATS=false
|
21 |
+
RUN mkdir -p /app/.streamlit
|
22 |
+
|
23 |
# Upgrade pip
|
24 |
RUN pip install --upgrade pip
|
25 |
|
26 |
+
# Install PyTorch first to avoid build issues with torch-scatter
|
27 |
RUN pip install torch==2.1.2
|
28 |
|
29 |
+
# Install torch-scatter and torch-sparse with appropriate PyTorch compatibility
|
30 |
+
RUN pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.1.0+cpu.html
|
31 |
+
|
32 |
+
# Install all remaining dependencies
|
33 |
COPY requirements.txt ./
|
34 |
RUN pip install --no-cache-dir -r requirements.txt
|
35 |
|
|
|
39 |
# Expose port and define entrypoint
|
40 |
EXPOSE 8501
|
41 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
42 |
+
|
43 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|