-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (40 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
50 lines (40 loc) · 1.27 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM --platform=linux/amd64 ghcr.io/astral-sh/uv:python3.11-bookworm-slim
# Install system dependencies including KLayout
RUN apt-get update && apt-get install -y \
curl \
gcc \
g++ \
make \
cmake \
git \
build-essential \
libpng-dev \
libcurl4-openssl-dev \
libexpat1-dev \
python3-dev \
klayout \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
bash /tmp/miniconda.sh -b -p /opt/conda && \
rm /tmp/miniconda.sh
# Add conda to PATH
ENV PATH="/opt/conda/bin:${PATH}"
# Create conda environment with Python 3.11 (matching the base image)
RUN conda create -n pymeep python=3.11 -y
RUN echo "source activate pymeep" >> ~/.bashrc
ENV PATH="/opt/conda/envs/pymeep/bin:${PATH}"
# Install conda packages in the pymeep environment
RUN conda install -n pymeep -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
# Create and activate uv virtual environment
RUN uv venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
WORKDIR /app
COPY . .
# Install the rest of your requirements
RUN uv pip install -e ".[dev,docs,femwell,gmsh,meow,sax,tidy3d,klayout,vlsir]"
USER non-root
# Set the default command
CMD ["bash"]