working dockerfile
This commit is contained in:
48
Dockerfile
48
Dockerfile
@@ -1,38 +1,46 @@
|
|||||||
FROM python:3.12-slim
|
FROM condaforge/mambaforge:latest
|
||||||
|
|
||||||
|
ARG MAMBA_DOCKERFILE_ACTIVATE=1
|
||||||
|
|
||||||
# 设置工作目录
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 设置环境变量
|
|
||||||
ENV PYTHONPATH=/app
|
ENV PYTHONPATH=/app
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
# 安装系统依赖
|
# Install dependencies in micromamba base env
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN mamba install -y -c conda-forge \
|
||||||
gcc \
|
python=3.12 \
|
||||||
g++ \
|
pip \
|
||||||
curl \
|
curl \
|
||||||
unzip \
|
unzip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
c-compiler \
|
||||||
|
cxx-compiler \
|
||||||
|
ca-certificates \
|
||||||
|
vim \
|
||||||
|
&& mamba clean -a -y
|
||||||
|
|
||||||
# 复制项目文件
|
|
||||||
COPY pyproject.toml ./
|
COPY pyproject.toml ./
|
||||||
COPY fastapi_server/requirements.txt ./fastapi_server/
|
COPY fastapi_server/requirements.txt ./fastapi_server/
|
||||||
COPY lang_agent/ ./lang_agent/
|
COPY lang_agent/ ./lang_agent/
|
||||||
COPY fastapi_server/ ./fastapi_server/
|
COPY fastapi_server/ ./fastapi_server/
|
||||||
|
|
||||||
# download req files
|
# RUN curl -o ./.env http://6.6.6.86:8888/download/resources/.env
|
||||||
RUN curl -o ./.env http://6.6.6.86:8888/download/resources/.env
|
# && \
|
||||||
RUN curl -o ./assets.zip http://6.6.6.86:8888/download/resources/assets.zip
|
# curl -o ./assets.zip http://6.6.6.86:8888/download/resources/assets.zip && \
|
||||||
RUN unzip assets.zip
|
# unzip assets.zip && \
|
||||||
RUN rm assets.zip
|
# rm assets.zip
|
||||||
|
|
||||||
# 安装Python依赖
|
# Install Python dependencies inside micromamba env
|
||||||
RUN pip install --no-cache-dir -r fastapi_server/requirements.txt
|
RUN python -m pip install --upgrade pip && \
|
||||||
RUN pip install --no-cache-dir -e .
|
python -m pip install --no-cache-dir -r fastapi_server/requirements.txt \
|
||||||
|
-i https://mirrors.aliyun.com/pypi/simple/ \
|
||||||
|
--trusted-host mirrors.aliyun.com \
|
||||||
|
--default-timeout=300 && \
|
||||||
|
python -m pip install --no-cache-dir -e . \
|
||||||
|
-i https://mirrors.aliyun.com/pypi/simple/ \
|
||||||
|
--trusted-host mirrors.aliyun.com \
|
||||||
|
--default-timeout=300
|
||||||
|
|
||||||
# 暴露端口
|
|
||||||
EXPOSE 8488
|
EXPOSE 8488
|
||||||
|
|
||||||
# 启动命令
|
CMD ["micromamba", "run", "-n", "base", "python", "fastapi_server/server_dashscope.py"]
|
||||||
CMD ["python", "fastapi_server/server_dashscope.py"]
|
|
||||||
Reference in New Issue
Block a user