1+ FROM r-base:4.4.1
2+
3+ ENV DEBIAN_FRONTEND=noninteractive
4+
5+ # Update package list and install required packages
6+ RUN apt-get update && \
7+ apt-get install -y build-essential wget curl libcurl4-openssl-dev libxml2-dev \
8+ zlib1g-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev
9+
10+ # Download and compile Python 3.10 with shared library support
11+ RUN wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz && \
12+ tar -xf Python-3.10.12.tgz && \
13+ cd Python-3.10.12 && \
14+ ./configure --enable-optimizations --enable-shared && \
15+ make -j$(nproc) && \
16+ make altinstall && \
17+ cd .. && \
18+ rm -rf Python-3.10.12.tgz Python-3.10.12
19+
20+ # Set Python 3.10 as default
21+ RUN ln -s /usr/local/bin/python3.10 /usr/bin/python3 && \
22+ ln -s /usr/local/bin/pip3.10 /usr/bin/pip3
23+
24+ # Update library paths for Python shared library
25+ RUN echo "/usr/local/lib" >> /etc/ld.so.conf.d/python3.10.conf && ldconfig
26+
27+ # Create a Python virtual environment
28+ #RUN python3 -m venv /opt/venv
29+ #RUN /opt/venv/bin/pip install --upgrade pip
30+
31+ # Set environment variables for reticulate
32+ #ENV RETICULATE_PYTHON="/opt/venv/bin/python3"
33+ ENV PYTHONPATH=/app#"${PYTHONPATH}:/app"
34+ WORKDIR /app
35+
36+ # Set MPLCONFIGDIR to a writable directory and create it.
37+ ENV MPLCONFIGDIR=/app/tmp/matplotlib
38+ RUN mkdir -p /app/tmp/matplotlib
39+
40+
41+ # installing python libraries
42+ ADD build/novartispdx/requirements.txt .
43+ #RUN /opt/venv/bin/pip3 install -r requirements.txt
44+ RUN pip3 install -r requirements.txt
45+
46+ RUN python3 --version
47+
48+ #ENV PATH="/opt/venv/bin:$PATH"
49+
50+ ADD build/novartispdx/*py ./
51+ ADD build/novartispdx/*sh ./
52+
53+ ADD build/utils/* ./
0 commit comments