forked from RayanDhib/CFD-HOWL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (46 loc) · 1.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use an official Python runtime with broad compatibility
FROM python:3.8-slim-buster
# Set the working directory
WORKDIR /app
# Copy the current directory contents into the container
COPY . /app
# Install system dependencies for pyCGNS, scientific computing, and git
RUN apt-get update && apt-get install -y \
libhdf5-serial-dev \
zlib1g-dev \
cmake \
gfortran \
libgfortran5 \
libopenblas-dev \
liblapack-dev \
libpng-dev \
libjpeg-dev \
wget \
git \
&& apt-get clean
# Use a script to detect architecture and install the appropriate Miniforge version
RUN arch=$(uname -m) && \
if [ "$arch" = "x86_64" ]; then \
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniforge.sh; \
elif [ "$arch" = "aarch64" ]; then \
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh -O miniforge.sh; \
elif [ "$arch" = "ppc64le" ]; then \
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-ppc64le.sh -O miniforge.sh; \
elif [ "$arch" = "s390x" ]; then \
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-s390x.sh -O miniforge.sh; \
else \
echo "Unsupported architecture: $arch"; exit 1; \
fi && \
bash miniforge.sh -b -p /opt/conda && \
rm miniforge.sh && \
/opt/conda/bin/conda install -y python=3.9 numpy scipy vtk h5py && \
/opt/conda/bin/conda clean -afy
# Set path to conda
ENV PATH=/opt/conda/bin:$PATH
# Install pyCGNS from source
RUN git clone https://github.com/pyCGNS/pyCGNS.git /tmp/pyCGNS && \
cd /tmp/pyCGNS && \
python setup.py install && \
rm -rf /tmp/pyCGNS
# Default command
CMD ["python", "main.py"]