Skip to main content

Posts

Showing posts from August, 2018

Publishing net core app on Heroku

You know that there are no much .Net hosting, so for testing porpuse is somethimes hard to find a way to preview your project. This how to publish a .Net core app(also .Net applications, like mvc, etc) on Heroku Requirements. * an Account on Heroku(and download heroku-cli) * A few knowledge of Docker(this is the approach to publish) download docker-tools for windows * your .Net Core app(create a empty project .net core api if you don't have one) Steps: Create a Docker file at solution/project level: content: FROM microsoft/aspnetcore:2.0.5 WORKDIR /app COPY . . CMD ASPNETCORE_URLS=http://*:$PORT dotnet coolbox.sale.api.dll Compile your project as Release on cmd go to your publish folder(usually: bin/Release/netcoreapp2.0/publish) execute this steps 1. Login on heroku     heroku login 2. login in container     heroku container:login 3. publish api or     dotnet publish -c Release 4. Copy DOCKERFILE to publish directory     ./bin/release/net