Guest User

Untitled

a guest
Mar 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. FROM microsoft/aspnetcore-build:2.0 AS build-env
  2. WORKDIR /app
  3.  
  4. # Copy csproj and restore as distinct layers
  5. COPY *.csproj ./
  6. RUN dotnet restore
  7.  
  8. # Copy everything else and build
  9. COPY . ./
  10. RUN dotnet publish -c Release -o out
  11.  
  12. # Build runtime image
  13. FROM microsoft/aspnetcore:2.0
  14. WORKDIR /app
  15. COPY --from=build-env /app/out .
  16. CMD ASPNETCORE_URLS=http://*:$PORT dotnet <YOUR_API_NAME>.dll
  17.  
  18. docker build -t aspnetapp <YOUR_API_NAME>
  19. docker login --username=$HEROKU_USERNAME --password=$HEROKU_API_KEY registry.heroku.com
  20. docker tag aspnetapp registry.heroku.com/$HEROKU_APP_NAME/web
  21. docker push registry.heroku.com/$HEROKU_APP_NAME/web
Add Comment
Please, Sign In to add comment