Cybercrux

Everything is achievable through technology

Docker

FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80

# install System.Drawing native dependencies
RUN apt-get update \
    && apt-get install -y --allow-unauthenticated \
        libc6-dev \
        libgdiplus \
        libx11-dev \
     && rm -rf /var/lib/apt/lists/*

FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY . .

WORKDIR “/src”
RUN dotnet build -c Release

WORKDIR “/src/xxx.Service.Test”
RUN dotnet test –no-build -c Release

FROM build AS publish
WORKDIR “/src/xxx.API”
RUN dotnet publish “xxx.API.csproj” -c Release -o /app

FROM base AS final
WORKDIR /app
COPY –from=publish /app .
ENTRYPOINT [“dotnet”, “xxx.API.dll”]

docker build -f xxx.API/Dockerfile -t xxx.api:test .

docker run -d -p 8888:80 xxx.api:test