Browse Source

Updates to make it work with Docker

- Dockerfiles changes
- Minor csproj updates to bring back "dotnet bundle" cli
- Enable all protocols in SignalR
- Update package-lock.json in spa
pull/632/head
eiximenis 6 years ago
parent
commit
684aa4927f
19 changed files with 6883 additions and 9997 deletions
  1. +1
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
  2. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
  3. +1
    -1
      src/Services/Basket/Basket.API/Dockerfile
  4. +1
    -1
      src/Services/Catalog/Catalog.API/Dockerfile
  5. +2
    -1
      src/Services/Catalog/Catalog.API/Startup.cs
  6. +3
    -2
      src/Services/Identity/Identity.API/Dockerfile
  7. +4
    -0
      src/Services/Identity/Identity.API/Identity.API.csproj
  8. +1
    -1
      src/Services/Location/Locations.API/Dockerfile
  9. +1
    -1
      src/Services/Marketing/Marketing.API/Dockerfile
  10. +1
    -1
      src/Services/Ordering/Ordering.API/Dockerfile
  11. +1
    -1
      src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile
  12. +3
    -5
      src/Services/Ordering/Ordering.SignalrHub/Dockerfile
  13. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/Startup.cs
  14. +1
    -1
      src/Services/Payment/Payment.API/Dockerfile
  15. +3
    -2
      src/Web/WebMVC/Dockerfile
  16. +5
    -0
      src/Web/WebMVC/WebMVC.csproj
  17. +3
    -2
      src/Web/WebSPA/Dockerfile
  18. +6849
    -9974
      src/Web/WebSPA/package-lock.json
  19. +1
    -1
      src/Web/WebStatus/Dockerfile

+ 1
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/ApiGateways/Mobile.Bff.Shopping/aggregator
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/ApiGateways/Web.Bff.Shopping/aggregator
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 1
- 1
src/Services/Basket/Basket.API/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Basket/Basket.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 1
- 1
src/Services/Catalog/Catalog.API/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Catalog/Catalog.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 2
- 1
src/Services/Catalog/Catalog.API/Startup.cs View File

@ -47,6 +47,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
.AddCustomMVC(Configuration)
.AddCustomDbContext(Configuration)
.AddCustomOptions(Configuration)
.AddIntegrationServices(Configuration)
.AddEventBus(Configuration)
.AddSwagger();
@ -228,7 +229,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
}
public static IServiceCollection AddIntegrationServices(IServiceCollection services, IConfiguration configuration)
public static IServiceCollection AddIntegrationServices(this IServiceCollection services, IConfiguration configuration)
{
services.AddTransient<Func<DbConnection, IIntegrationEventLogService>>(
sp => (DbConnection c) => new IntegrationEventLogService(c));


+ 3
- 2
src/Services/Identity/Identity.API/Dockerfile View File

@ -2,11 +2,12 @@ FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
FROM microsoft/aspnetcore-build:2.1.300-preview1 as build
RUN npm install -g bower@1.8.4
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Identity/Identity.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 4
- 0
src/Services/Identity/Identity.API/Identity.API.csproj View File

@ -31,6 +31,10 @@
<Exec Command="dotnet bundle" Condition="'$(ASPNETCORE_ENVIRONMENT)'!='Development'" />
</Target>
<ItemGroup>
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.7.385" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Certificate\idsrv3test.pfx" />
</ItemGroup>


+ 1
- 1
src/Services/Location/Locations.API/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Location/Locations.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 1
- 1
src/Services/Marketing/Marketing.API/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Marketing/Marketing.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 1
- 1
src/Services/Ordering/Ordering.API/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Ordering/Ordering.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 1
- 1
src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Ordering/Ordering.BackgroundTasks
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 3
- 5
src/Services/Ordering/Ordering.SignalrHub/Dockerfile View File

@ -4,15 +4,13 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY eShopOnContainers-ServicesAndWebApps.sln ./
COPY src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj src/Services/Ordering/Ordering.SignalrHub/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/src/Services/Ordering/Ordering.SignalrHub
RUN dotnet build Ordering.SignalrHub.csproj -c Release -o /app
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore Ordering.SignalrHub.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish Ordering.SignalrHub.csproj -c Release -o /app
RUN dotnet publish --no-restore Ordering.SignalrHub.csproj -c Release -o /app
FROM base AS final
WORKDIR /app


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/Startup.cs View File

@ -134,7 +134,7 @@ namespace Ordering.SignalrHub
app.UseSignalR(routes =>
{
routes.MapHub<NotificationsHub>("/notificationhub", options =>
options.Transports = Microsoft.AspNetCore.Http.Connections.HttpTransportType.WebSockets);
options.Transports = Microsoft.AspNetCore.Http.Connections.HttpTransports.All);
});
ConfigureEventBus(app);


+ 1
- 1
src/Services/Payment/Payment.API/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Payment/Payment.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 3
- 2
src/Web/WebMVC/Dockerfile View File

@ -2,11 +2,12 @@ FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
FROM microsoft/aspnetcore-build:2.1.300-preview1 AS build
RUN npm install -g bower@1.8.4
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Web/WebMVC
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 5
- 0
src/Web/WebMVC/WebMVC.csproj View File

@ -34,6 +34,11 @@
<Exec Command="dotnet bundle" Condition="'$(ASPNETCORE_ENVIRONMENT)'!='Development'" />
</Target>
<ItemGroup>
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.7.385" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\BuildingBlocks\HealthChecks\src\Microsoft.AspNetCore.HealthChecks\Microsoft.AspNetCore.HealthChecks.csproj" />
<ProjectReference Include="..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" />


+ 3
- 2
src/Web/WebSPA/Dockerfile View File

@ -2,11 +2,12 @@ FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
FROM microsoft/aspnetcore-build:2.1.300-preview1 AS build
RUN npm i -g npm
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Web/WebSPA
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


+ 6849
- 9974
src/Web/WebSPA/package-lock.json
File diff suppressed because it is too large
View File


+ 1
- 1
src/Web/WebStatus/Dockerfile View File

@ -5,8 +5,8 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY . .
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Web/WebStatus
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish


Loading…
Cancel
Save