diff --git a/samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj b/samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj index 1d3cc7a..f238298 100644 --- a/samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj +++ b/samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj @@ -6,14 +6,13 @@ enable CRM.Blazor.Web Linux + 64c4627c-4e94-4b4f-97d8-49f7a3a2ce3d + ..\.. - - .dockerignore - @@ -25,6 +24,7 @@ + diff --git a/samples/CRM.Blazor.Web/Dockerfile b/samples/CRM.Blazor.Web/Dockerfile index 867ad1c..e3b3292 100644 --- a/samples/CRM.Blazor.Web/Dockerfile +++ b/samples/CRM.Blazor.Web/Dockerfile @@ -1,5 +1,7 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base -USER $APP_UID +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER app WORKDIR /app EXPOSE 8080 EXPOSE 8081 @@ -16,16 +18,16 @@ COPY ["samples/CRM.Domain/CRM.Domain.csproj", "samples/CRM.Domain/"] COPY ["samples/CRM.Aspire.ServiceDefaults/CRM.Aspire.ServiceDefaults.csproj", "samples/CRM.Aspire.ServiceDefaults/"] COPY ["samples/CRM.HttpApi/CRM.HttpApi.csproj", "samples/CRM.HttpApi/"] COPY ["samples/CRM.EntityFrameworkCore/CRM.EntityFrameworkCore.csproj", "samples/CRM.EntityFrameworkCore/"] -RUN dotnet restore "samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj" +RUN dotnet restore "./samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj" COPY . . WORKDIR "/src/samples/CRM.Blazor.Web" -RUN dotnet build "CRM.Blazor.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build +RUN dotnet build "./CRM.Blazor.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "CRM.Blazor.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false +RUN dotnet publish "./CRM.Blazor.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "CRM.Blazor.Web.dll"] +ENTRYPOINT ["dotnet", "CRM.Blazor.Web.dll"] \ No newline at end of file diff --git a/samples/CRM.Blazor.Web/Properties/launchSettings.json b/samples/CRM.Blazor.Web/Properties/launchSettings.json index 22eefbd..aa2836b 100644 --- a/samples/CRM.Blazor.Web/Properties/launchSettings.json +++ b/samples/CRM.Blazor.Web/Properties/launchSettings.json @@ -1,38 +1,49 @@ { - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:28922", - "sslPort": 44359 - } - }, - "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "http://localhost:5019", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "https://localhost:7201;http://localhost:5019", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5019" + }, + "https": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7201;http://localhost:5019" + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:28922", + "sslPort": 44359 } } +} \ No newline at end of file