forked from CBZ199671/PyEIDORS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.38 KB
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1.38 KB
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
FROM ghcr.io/scientificcomputing/fenics-gmsh:2024-05-30
# Build a PyEIDORS-ready environment on top of the official FEniCS+Gmsh image.
#
# This image is intended to be used by mounting the repository into /root/shared,
# so you can iterate on code without rebuilding the image.
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root/shared
# Install CJK fonts (optional, but useful for plots with Chinese labels).
# Note: different base images may use different package names; try both.
RUN apt-get update && \
(apt-get install -y --no-install-recommends fonts-wqy-zenhei || apt-get install -y --no-install-recommends ttf-wqy-zenhei) && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install CUQIpy packages and the uv package manager.
RUN pip install --no-cache-dir cuqipy cuqipy-fenics uv
# Create a virtual environment using system site packages (FEniCS is provided by the base image).
RUN uv venv /opt/final_venv --system-site-packages
ENV VIRTUAL_ENV=/opt/final_venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Install GPU-enabled PyTorch (cu128).
RUN uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
# Remove numpy from the venv to avoid potential conflicts with the base image numpy.
RUN uv pip uninstall -y numpy || true
# Auto-activate the venv in interactive shells.
RUN echo "source /opt/final_venv/bin/activate" >> /root/.bashrc
CMD ["/bin/bash"]