forked from dotnet-architecture/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding instructions and cleaning up.
- Loading branch information
Showing
3 changed files
with
41 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base | ||
# RUN BOTH CONTAINERS FROM ROOT (folder with .sln file): | ||
# docker-compose build | ||
# docker-compose up | ||
# | ||
# RUN JUST THIS CONTAINER FROM ROOT (folder with .sln file): | ||
# docker build --pull -t web -f src/Web/Dockerfile . | ||
# | ||
# RUN COMMAND | ||
# docker run --name eshopweb --rm -it -p 8000:5106 web | ||
FROM microsoft/dotnet:2.1-sdk AS build | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
FROM microsoft/aspnetcore-build:2.1.300-preview1 AS build | ||
RUN npm install -g bower@1.8.4 | ||
WORKDIR /src | ||
COPY *.sln . | ||
COPY . . | ||
WORKDIR /src/src/Web | ||
RUN dotnet restore -nowarn:msb3202,nu1503 | ||
RUN dotnet build --no-restore -c Release -o /app | ||
WORKDIR /app/src/Web | ||
RUN dotnet restore | ||
|
||
FROM build AS publish | ||
RUN dotnet publish --no-restore -c Release -o /app | ||
RUN dotnet publish -c Release -o out | ||
|
||
FROM base AS final | ||
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime | ||
WORKDIR /app | ||
COPY --from=publish /app . | ||
COPY --from=build /app/src/Web/out ./ | ||
|
||
# Optional: Set this here if not setting it from docker-compose.yml | ||
# ENV ASPNETCORE_ENVIRONMENT Development | ||
|
||
ENTRYPOINT ["dotnet", "Web.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base | ||
# RUN BOTH CONTAINERS FROM ROOT (folder with .sln file): | ||
# docker-compose build | ||
# docker-compose up | ||
# | ||
# RUN JUST THIS CONTAINER FROM ROOT (folder with .sln file): | ||
# docker build --pull -t webrazor -f src/WebRazorPages/Dockerfile . | ||
# | ||
# RUN COMMAND | ||
# docker run --name eshopweb --rm -it -p 5107:5107 webrazor | ||
FROM microsoft/dotnet:2.1-sdk AS build | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
FROM microsoft/aspnetcore-build:2.1.300-preview1 AS build | ||
RUN npm install -g bower@1.8.4 | ||
WORKDIR /src | ||
COPY *.sln . | ||
COPY . . | ||
WORKDIR /src/src/WebRazorPages | ||
RUN dotnet restore -nowarn:msb3202,nu1503 | ||
RUN dotnet build --no-restore -c Release -o /app | ||
WORKDIR /app/src/WebRazorPages | ||
RUN dotnet restore | ||
|
||
FROM build AS publish | ||
RUN dotnet publish --no-restore -c Release -o /app | ||
RUN dotnet publish -c Release -o out | ||
|
||
FROM base AS final | ||
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime | ||
WORKDIR /app | ||
COPY --from=publish /app . | ||
COPY --from=build /app/src/WebRazorPages/out ./ | ||
|
||
# Optional: Set this here if not setting it from docker-compose.yml | ||
# ENV ASPNETCORE_ENVIRONMENT Development | ||
|
||
ENTRYPOINT ["dotnet", "Microsoft.eShopWeb.RazorPages.dll"] |