29 lines
759 B
Docker
29 lines
759 B
Docker
|
|
# Dockerfile for MoldInsight
|
||
|
|
FROM continuumio/miniconda3:latest
|
||
|
|
|
||
|
|
# 设置工作目录
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# 复制项目文件
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
# 更新conda并创建环境
|
||
|
|
RUN conda update -n base -c defaults conda -y && \
|
||
|
|
conda create -n moldinsight python=3.11 pythonocc-core=7.9.0 -c conda-forge -y
|
||
|
|
|
||
|
|
# 激活环境并安装Python依赖
|
||
|
|
RUN . /opt/conda/etc/profile.d/conda.sh && \
|
||
|
|
conda activate moldinsight && \
|
||
|
|
pip install -r requirements.txt
|
||
|
|
|
||
|
|
# 创建必要的目录
|
||
|
|
RUN mkdir -p uploads html_output logs
|
||
|
|
|
||
|
|
# 设置启动脚本
|
||
|
|
RUN chmod +x start.sh
|
||
|
|
|
||
|
|
# 暴露端口
|
||
|
|
EXPOSE 8000
|
||
|
|
|
||
|
|
# 启动命令(使用shell形式确保环境激活)
|
||
|
|
CMD ["/bin/bash", "-c", "source /opt/conda/etc/profile.d/conda.sh && conda activate moldinsight && python src/main.py"]
|