noahlee1234 commited on
Commit
f530152
·
1 Parent(s): 5a7dfba

Explicitly construct build123d dependencies to bridge pip and conda

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -8
Dockerfile CHANGED
@@ -1,12 +1,10 @@
1
  FROM continuumio/miniconda3:latest
2
 
3
- # Install system libraries
4
  RUN apt-get update && apt-get install -y \
5
  libgl1 \
6
  libglib2.0-0 \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- # Create a non-root user
10
  RUN useradd -m -u 1000 user
11
  USER user
12
  ENV HOME=/home/user \
@@ -15,20 +13,40 @@ ENV HOME=/home/user \
15
 
16
  WORKDIR $HOME/app
17
 
18
- # Create conda environment and install just the native dependencies (ocp/cadquery-ocp)
19
  RUN conda create -n cad python=3.10 -y && \
20
- conda install -n cad -c conda-forge "ocp>=7.8,<7.9" -y && \
21
  conda clean -a -y
22
 
23
  ENV PATH=$CONDA_DIR/envs/cad/bin:$PATH
24
 
25
- # Install pip requirements including build123d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  COPY --chown=user requirements.txt .
27
- RUN $CONDA_DIR/envs/cad/bin/pip install --no-cache-dir --upgrade pip && \
28
- $CONDA_DIR/envs/cad/bin/pip install --no-cache-dir -r requirements.txt
 
29
 
30
- # Setup app
31
  RUN mkdir -p artifacts/runs artifacts/logs
 
32
  COPY --chown=user . .
33
 
34
  EXPOSE 7860
 
1
  FROM continuumio/miniconda3:latest
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  libgl1 \
5
  libglib2.0-0 \
6
  && rm -rf /var/lib/apt/lists/*
7
 
 
8
  RUN useradd -m -u 1000 user
9
  USER user
10
  ENV HOME=/home/user \
 
13
 
14
  WORKDIR $HOME/app
15
 
 
16
  RUN conda create -n cad python=3.10 -y && \
17
+ conda install -n cad -c conda-forge ocp=7.8.1 -y && \
18
  conda clean -a -y
19
 
20
  ENV PATH=$CONDA_DIR/envs/cad/bin:$PATH
21
 
22
+ RUN pip install --no-cache-dir --upgrade pip
23
+
24
+ # Install all the python dependencies of build123d manually, except cadquery-ocp
25
+ RUN pip install --no-cache-dir \
26
+ "typing_extensions<5,>=4.6.0" \
27
+ "numpy" \
28
+ "svgpathtools<2,>=1.5.1" \
29
+ "anytree<3,>=2.8.0" \
30
+ "ezdxf<2,>=1.1.0" \
31
+ "ipython<10,>=8.0.0" \
32
+ "lib3mf>=2.4.1" \
33
+ "ocpsvg<0.6,>=0.5" \
34
+ "ocp_gordon>=0.1.17" \
35
+ "trianglesolver" \
36
+ "sympy" \
37
+ "scipy" \
38
+ "webcolors"
39
+
40
+ # Now install build123d without letting it try to pull cadquery-ocp
41
+ RUN pip install --no-cache-dir --no-deps build123d==0.10.0
42
+
43
  COPY --chown=user requirements.txt .
44
+ # Remove build123d from pip requirements since we just handled it
45
+ RUN grep -v "build123d" requirements.txt > reqs_no_cad.txt && \
46
+ pip install --no-cache-dir -r reqs_no_cad.txt
47
 
 
48
  RUN mkdir -p artifacts/runs artifacts/logs
49
+
50
  COPY --chown=user . .
51
 
52
  EXPOSE 7860