Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Multi-stage Dockerfile for checkout service #68

Merged
merged 2 commits into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions checkoutService/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM microsoft/dotnet:1.1.2-sdk
WORKDIR /app

# copy csproj and restore as distinct layers
COPY CheckoutService.csproj ./
FROM microsoft/aspnetcore-build:1.1.4 AS builder
WORKDIR /build
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o /publish-output

# copy and build everything else
COPY . ./
RUN dotnet publish -c Release -o out

CMD ["dotnet", "out/CheckoutService.dll", "--server.urls", "http://*:5000"]
FROM microsoft/aspnetcore:1.1.4
WORKDIR /app
COPY --from=builder /publish-output .
CMD ["dotnet", "CheckoutService.dll"]

1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ services:
- 5000:5000
environment:
ASPNETCORE_ENVIRONMENT: dev
ASPNETCORE_URLS: "http://*:5000"
links:
- mongo

Expand Down