ARG BASE_IMAGE=zibo.harbor.iluvatar.com.cn:30000/saas/mr-bi150-4.3.0.rc.8.20250607.llm-aarch64-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3 FROM ${BASE_IMAGE} # Installation arguments ARG PIP_INDEX=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple # 这里启用了 swanlab插件,可以通过swanlab来监督微调过程 ARG EXTRAS="torch,metrics,swanlab" ARG HTTP_PROXY="" # Define environments ENV MAX_JOBS=16 ENV VLLM_WORKER_MULTIPROC_METHOD=spawn # Set the working directory WORKDIR /app # Change pip source ENV PIP_INDEX_URL="${PIP_INDEX}" ENV PIP_EXTRA_INDEX_URL="${PIP_INDEX}" # Install the requirements COPY requirements.txt /app RUN pip install --no-cache-dir -r requirements.txt RUN pip install wheel # Copy the rest of the application into the image COPY . /app # Install LLaMA Factory RUN pip install --no-cache-dir -e ".[${EXTRAS}]" --no-build-isolation # Expose port 7860 for LLaMA Board ENV GRADIO_SERVER_PORT=7860 EXPOSE 7860 # Expose port 8000 for API service ENV API_PORT=8000 EXPOSE 8000 ENTRYPOINT ["/bin/bash"] CMD []