Iris314 commited on
Commit
2ff4e21
·
verified ·
1 Parent(s): a433871

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -5
Dockerfile CHANGED
@@ -2,6 +2,9 @@ FROM continuumio/miniconda3:latest
2
 
3
  WORKDIR /app
4
 
 
 
 
5
  # 安装系统依赖
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
@@ -21,20 +24,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
21
  && apt-get clean \
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
- # 直接在base环境安装
25
  RUN conda install -c conda-forge \
26
  python=3.10 \
27
  gradio \
28
- cadquery-ocp \
29
  -y && \
30
  conda clean --all -y
31
 
32
- # 验证安装
33
- RUN python -c "import sys; print('Python:', sys.version)" && \
34
- python -c "from OCP.STEPControl import STEPControl_Reader; print('OCP installed successfully')" || echo "OCP installation may have issues"
35
 
36
  COPY . /app/
37
 
38
  EXPOSE 7860
39
 
 
 
 
 
40
  CMD ["python", "/app/app.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PYTHONDONTWRITEBYTECODE=1
7
+
8
  # 安装系统依赖
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  build-essential \
 
24
  && apt-get clean \
25
  && rm -rf /var/lib/apt/lists/*
26
 
27
+ # 安装Python和gradio
28
  RUN conda install -c conda-forge \
29
  python=3.10 \
30
  gradio \
 
31
  -y && \
32
  conda clean --all -y
33
 
34
+ # 从PyPI安装cadquery-ocp
35
+ RUN pip install --no-cache-dir cadquery-ocp==7.8.1.1.post1
 
36
 
37
  COPY . /app/
38
 
39
  EXPOSE 7860
40
 
41
+ # 验证安装
42
+ RUN python -c "import sys; print('Python:', sys.version)" && \
43
+ python -c "from OCP.STEPControl import STEPControl_Reader; print('OCP installed successfully')"
44
+
45
  CMD ["python", "/app/app.py"]