2021-06-15 09:57:28 +01:00
|
|
|
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
|
|
|
|
2021-06-17 17:17:04 +01:00
|
|
|
ARG NODE_IMAGE=node:12.0
|
2021-11-15 19:02:23 +05:30
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
2016-11-17 10:34:10 +01:00
|
|
|
WORKDIR /app
|
2022-12-18 20:22:51 +02:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get -y install curl gnupg
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
|
|
|
RUN apt-get -y install nodejs
|
|
|
|
RUN npm install
|
|
|
|
RUN npm -v
|
|
|
|
RUN npm install -g @angular/cli@11.2.14
|
2017-02-14 18:11:51 +01:00
|
|
|
EXPOSE 80
|
2017-11-27 13:48:31 -08:00
|
|
|
|
2021-06-17 17:17:04 +01:00
|
|
|
FROM ${NODE_IMAGE} as node-build
|
2021-06-15 09:57:28 +01:00
|
|
|
WORKDIR /web/src
|
2021-06-15 15:34:41 +01:00
|
|
|
COPY Web/WebSPA/Client/package.json .
|
|
|
|
COPY Web/WebSPA/Client/package-lock.json .
|
2021-06-17 23:23:52 +01:00
|
|
|
RUN npm install -g npm@6
|
2021-06-15 09:57:28 +01:00
|
|
|
RUN npm install
|
2021-06-15 15:34:41 +01:00
|
|
|
COPY Web/WebSPA/Client .
|
2021-06-15 09:57:28 +01:00
|
|
|
RUN npm run build:prod
|
2018-06-01 18:59:14 +02:00
|
|
|
|
2021-11-15 19:02:23 +05:30
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
2017-11-27 13:48:31 -08:00
|
|
|
WORKDIR /src
|
2019-04-12 19:45:45 +01:00
|
|
|
|
2021-06-15 09:57:28 +01:00
|
|
|
# Create this "restore-solution" section by running ./Create-DockerfileSolutionRestore.ps1, to optimize build cache reuse
|
2021-06-15 15:34:41 +01:00
|
|
|
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
|
|
|
|
|
|
|
|
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
|
|
|
|
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
|
|
|
|
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
|
|
|
|
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
|
|
|
|
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
|
|
|
|
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
|
|
|
|
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
|
|
|
|
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
|
|
|
|
COPY "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj"
|
|
|
|
COPY "Services/Basket/Basket.API/Basket.API.csproj" "Services/Basket/Basket.API/Basket.API.csproj"
|
|
|
|
COPY "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj" "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj"
|
|
|
|
COPY "Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj" "Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj"
|
|
|
|
COPY "Services/Catalog/Catalog.API/Catalog.API.csproj" "Services/Catalog/Catalog.API/Catalog.API.csproj"
|
|
|
|
COPY "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj"
|
|
|
|
COPY "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj"
|
|
|
|
COPY "Services/Identity/Identity.API/Identity.API.csproj" "Services/Identity/Identity.API/Identity.API.csproj"
|
|
|
|
COPY "Services/Ordering/Ordering.API/Ordering.API.csproj" "Services/Ordering/Ordering.API/Ordering.API.csproj"
|
|
|
|
COPY "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj"
|
|
|
|
COPY "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj"
|
|
|
|
COPY "Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj" "Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj"
|
|
|
|
COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj" "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
|
|
|
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
|
|
|
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
|
|
|
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
|
|
|
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
|
|
|
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
|
|
|
COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj"
|
|
|
|
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
|
|
|
|
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
|
|
|
|
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
|
|
|
|
|
|
|
|
COPY "docker-compose.dcproj" "docker-compose.dcproj"
|
|
|
|
|
|
|
|
COPY "NuGet.config" "NuGet.config"
|
|
|
|
|
|
|
|
RUN dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
2019-11-18 15:04:11 +00:00
|
|
|
|
2017-11-27 13:48:31 -08:00
|
|
|
COPY . .
|
2021-06-15 15:34:41 +01:00
|
|
|
COPY --from=node-build /web/wwwroot /src/Web/WebSPA/wwwroot/
|
|
|
|
WORKDIR /src/Web/WebSPA
|
2022-12-18 20:22:51 +02:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get -y install curl gnupg
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
|
|
|
RUN apt-get -y install nodejs
|
|
|
|
RUN npm install
|
|
|
|
RUN npm -v
|
|
|
|
RUN npm install -g @angular/cli@11.2.14
|
2021-06-15 15:34:41 +01:00
|
|
|
RUN dotnet publish --no-restore -c Release -o /app
|
2019-04-12 19:45:45 +01:00
|
|
|
|
|
|
|
FROM build AS publish
|
2017-11-27 13:48:31 -08:00
|
|
|
|
|
|
|
FROM base AS final
|
|
|
|
WORKDIR /app
|
2021-06-15 15:34:41 +01:00
|
|
|
COPY --from=publish /app .
|
2021-06-15 09:57:28 +01:00
|
|
|
ENTRYPOINT ["dotnet", "WebSPA.dll"]
|