24 lines
1.1 KiB
Docker
24 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
ARG SDK_IMAGE=mcr.microsoft.com/dotnet/sdk:10.0
|
|
ARG RUNTIME_IMAGE=mcr.microsoft.com/dotnet/aspnet:10.0
|
|
|
|
FROM ${SDK_IMAGE} AS build
|
|
ARG NUGET_FEED_URL=https://gitea.dream-views.com/api/packages/AgileWebs/nuget/index.json
|
|
ARG NUGET_FEED_USERNAME=
|
|
ARG NUGET_FEED_TOKEN=
|
|
WORKDIR /src
|
|
COPY . .
|
|
|
|
RUN if [ -n "$NUGET_FEED_USERNAME" ] && [ -n "$NUGET_FEED_TOKEN" ]; then dotnet nuget add source "$NUGET_FEED_URL" --name gitea-org --username "$NUGET_FEED_USERNAME" --password "$NUGET_FEED_TOKEN" --store-password-in-clear-text --allow-insecure-connections --configfile /root/.nuget/NuGet/NuGet.Config; fi
|
|
|
|
RUN dotnet restore "src/Thalos.Service.Grpc/Thalos.Service.Grpc.csproj" --configfile /root/.nuget/NuGet/NuGet.Config
|
|
RUN dotnet publish "src/Thalos.Service.Grpc/Thalos.Service.Grpc.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore
|
|
|
|
FROM ${RUNTIME_IMAGE} AS runtime
|
|
WORKDIR /app
|
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
EXPOSE 8080
|
|
EXPOSE 8081
|
|
COPY --from=build /app/publish .
|
|
ENTRYPOINT ["dotnet", "Thalos.Service.Grpc.dll"]
|