diff --git a/.dockerignore b/.dockerignore index dd3d414234..7e89668a33 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,7 +7,6 @@ docker-compose*.yml docker-compose.dcproj *.sln -!eShopOnContainers-ServicesAndWebApps.sln *.md hosts LICENSE @@ -31,4 +30,11 @@ cli-linux **/wwwroot/lib/* global.json **/appsettings.localhost.json -src/Web/WebSPA/wwwroot/ \ No newline at end of file +src/Web/WebSPA/wwwroot/ +packages/ +csproj-files/ +test-results/ +TestResults/ +src/Mobile/ +src/Web/Catalog.WebForms/ +src/Web/WebMonolithic/ diff --git a/.gitignore b/.gitignore index 8bad337c52..8f5d1ce45a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,9 @@ bld/ # Visual Studio 2015 cache/options directory .vs/ +# Dockerfile projects folder for restore-packages script +csproj-files/ + # .js files created on build: src/Web/WebMVC/wwwroot/js/site* diff --git a/Dockerfile-scripts/restore-packages b/Dockerfile-scripts/restore-packages new file mode 100644 index 0000000000..1f97db3f3c --- /dev/null +++ b/Dockerfile-scripts/restore-packages @@ -0,0 +1,3 @@ +#!/bin/bash + +for f in *.csproj; do dotnet restore --no-dependencies ../csproj-files/$f; done diff --git a/restore-packages.cmd b/restore-packages.cmd new file mode 100644 index 0000000000..4e99614d63 --- /dev/null +++ b/restore-packages.cmd @@ -0,0 +1 @@ +for /R %%f in (*.csproj) do dotnet restore --no-dependencies %%f diff --git a/src/Services/Ordering/Ordering.API/Dockerfile b/src/Services/Ordering/Ordering.API/Dockerfile index 96aa10404d..ce6ba50fa9 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile +++ b/src/Services/Ordering/Ordering.API/Dockerfile @@ -4,21 +4,24 @@ EXPOSE 80 FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build WORKDIR /src -COPY . . -WORKDIR /src/src/Services/Ordering/Ordering.API -RUN dotnet restore -nowarn:msb3202,nu1503 -RUN dotnet build --no-restore -c Release -o /app +COPY **/*.csproj csproj-files/ +# WORKDIR /src/Dockerfile-scripts +# RUN restore-packages +# COPY . . +# 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 functionaltest -WORKDIR /src/src/Services/Ordering/Ordering.FunctionalTests +# FROM build as functionaltest +# WORKDIR /src/src/Services/Ordering/Ordering.FunctionalTests -FROM build as unittest -WORKDIR /src/src/Services/Ordering/Ordering.UnitTests +# FROM build as unittest +# WORKDIR /src/src/Services/Ordering/Ordering.UnitTests -FROM build AS publish -RUN dotnet publish --no-restore -c Release -o /app +# FROM build AS publish +# RUN dotnet publish --no-restore -c Release -o /app -FROM base AS final -WORKDIR /app -COPY --from=publish /app . -ENTRYPOINT ["dotnet", "Ordering.API.dll"] +# FROM base AS final +# WORKDIR /app +# COPY --from=publish /app . +# ENTRYPOINT ["dotnet", "Ordering.API.dll"]