Iris314 commited on
Commit
bb8728c
·
verified ·
1 Parent(s): 5fefe6f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -17
Dockerfile CHANGED
@@ -1,11 +1,8 @@
1
- FROM continuumio/miniconda3:latest
2
 
3
  WORKDIR /app
4
 
5
- ENV PYTHONUNBUFFERED=1 \
6
- PYTHONDONTWRITEBYTECODE=1
7
-
8
- # 安装OCP所需的系统依赖
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  build-essential \
11
  git \
@@ -24,20 +21,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
24
  && apt-get clean \
25
  && rm -rf /var/lib/apt/lists/*
26
 
27
- # 创建conda环境,锁定Python 3.10
28
- RUN conda create -n ocp python=3.10 -y && \
29
- conda clean --all -y
30
-
31
- # 激活环境并安装pythonocc-core
32
- COPY requirements.txt /app/
33
-
34
- RUN bash -c "source activate ocp && \
35
- conda install -c conda-forge pythonocc-core=7.7.0 gradio -y && \
36
- conda clean --all -y"
37
 
38
  COPY . /app/
39
 
40
  EXPOSE 7860
41
 
42
- SHELL ["bash", "-c", "source activate ocp &&"]
43
- CMD ["python", "app.py"]
 
1
+ FROM mambaforge:latest
2
 
3
  WORKDIR /app
4
 
5
+ # 安装系统依赖
 
 
 
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  git \
 
21
  && apt-get clean \
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
+ # 直接在base环境安装(不创建新环境)
25
+ RUN mamba install -c conda-forge \
26
+ python=3.10 \
27
+ pythonocc-core=7.8.1.1 \
28
+ gradio \
29
+ -y && \
30
+ mamba clean --all -y
 
 
 
31
 
32
  COPY . /app/
33
 
34
  EXPOSE 7860
35
 
36
+ CMD ["python", "/app/app.py"]