Merge pull request #454 from yanchenw/dev

Optimize multistage build
This commit is contained in:
Cesar De la Torre 2018-01-04 15:37:05 -08:00 committed by GitHub
commit 03c5063634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 31 additions and 1128 deletions

View File

@ -7,7 +7,7 @@
docker-compose*.yml
docker-compose.dcproj
*.sln
!eShopOnContainers-ServicesAndWebApps-MultiStageBuild.sln
!eShopOnContainers-ServicesAndWebApps.sln
*.md
hosts
LICENSE

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Basket/Basket.API
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Services/Basket/Basket.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Catalog/Catalog.API
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Services/Catalog/Catalog.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Identity/Identity.API
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Services/Identity/Identity.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Location/Locations.API
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Services/Location/Locations.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Marketing/Marketing.API
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Services/Marketing/Marketing.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Ordering/Ordering.API
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Services/Ordering/Ordering.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Services/Payment/Payment.API
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Services/Payment/Payment.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Web/WebMVC
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Web/WebMVC
RUN bower install --allow-root
RUN dotnet bundle
RUN dotnet publish --no-restore -c Release -o /app

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Web/WebSPA
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Web/WebSPA
RUN npm rebuild node-sass
RUN npm install
RUN npm run build:prod

View File

@ -5,10 +5,11 @@ EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY . .
RUN dotnet build -c Release -nowarn:msb3202,nu1503
RUN dotnet restore -nowarn:msb3202,nu1503
WORKDIR /src/src/Web/WebStatus
RUN dotnet build --no-restore -c Release -o /app
FROM build AS publish
WORKDIR /src/src/Web/WebStatus
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final