diff --git a/Dockerfile-py b/Dockerfile-py index 97540d9..4c01762 100644 --- a/Dockerfile-py +++ b/Dockerfile-py @@ -1,8 +1,4 @@ -# 1. Define the Python image to use for getting pip -FROM pytorch/pytorch AS python-base - -# 2. Define the .NET SDK image to build your application -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["src/AntSK/AntSK.csproj", "AntSK/"] RUN dotnet restore "AntSK/AntSK.csproj" @@ -11,19 +7,11 @@ WORKDIR "/src/AntSK" RUN dotnet build "AntSK.csproj" -c Release -o /app/build RUN dotnet publish "AntSK.csproj" -c Release -o /app/publish -# 3. Define the final image that will contain both .NET runtime and Python -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final - -# Copy the Python/pip installation from the official Python image -COPY --from=python-base /usr/local /usr/local -COPY --from=python-base /opt/conda/ /opt/conda/ +FROM registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk-base:v1.0.0 AS final WORKDIR /app COPY --from=build /app/publish . -# Make sure the app and Python directories are in PATH -ENV PATH="/app:/opt/conda/bin:/usr/local/bin:${PATH}" +ENV PATH="/app:/opt/conda/bin:/usr/local/bin:${PATH}" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' >/etc/timezone -RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -RUN apt update && apt install -y libpugixml-dev libtbb-dev ENTRYPOINT ["dotnet", "AntSK.dll"] diff --git a/docker-compose.simple.yml b/docker-compose.simple.yml index 215cda5..5bec072 100644 --- a/docker-compose.simple.yml +++ b/docker-compose.simple.yml @@ -3,9 +3,9 @@ version: '3.8' services: antsk: container_name: antsk - image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:v0.4.1 + image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:v0.4.3 # 如果需要pytorch环境需要使用下面这个镜像,镜像比较大 - # image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:p0.4.1 + # image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:p0.4.3 ports: - 5000:5000 networks: diff --git a/docker-compose.yml b/docker-compose.yml index 005e7e5..1e2c9e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,9 +32,9 @@ services: - ./pg/data:/var/lib/postgresql/data antsk: container_name: antsk - image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:v0.4.1 + image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:v0.4.3 # 如果需要pytorch环境需要使用下面这个镜像,镜像比较大 - # image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:p0.4.1 + # image: registry.cn-hangzhou.aliyuncs.com/xuzeyu91/antsk:p0.4.3 ports: - 5000:5000 networks: