Here's another way you could make this work with Heroku.
Create a Dockerfile in the root of your solution
#https://github.com/dotnet/dotnet-docker/tree/master/samples/aspnetapp
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /app
COPY . .
CMD ASPNETCORE_URLS=http://*:$PORT dotnet [THE NAME OF YOUR FILE].dll
Create a simple batch file (Assumed Windows OS) called "publish.bat"
NOTE - When dotnet clean is ran, it doesn't clean out the publish folder. I recommend you delete the contents of the directory before publishing. You can add it to the batch file as you see fit.
REM - This file assumes that you have access to the application and that you have docker installed
REM : Setup your applications name below
SET APP_NAME=""
REM - Delete all files and folders in publish
del /q ".\bin\Release\netcoreapp2.1\publish\*"
FOR /D %%p IN (".\bin\Release\netcoreapp2.1\publish\*.*") DO rmdir "%%p" /s /q
dotnet clean --configuration Release
dotnet publish -c Release
copy Dockerfile .\bin\Release\netcoreapp2.1\publish\
cd .\bin\Release\netcoreapp2.1\publish\
call heroku container:login
call heroku container:push web -a %APP_NAME%
call heroku container:release web -a %APP_NAME%
From the root of your solution, now just run publish.bat
c:\dev\my-amazing-app\publish.bat
Information:
CMD ASPNETCORE_URLS=http://*:$PORT dotnet Blogifier.Web.dll
withENTRYPOINT ["dotnet", "Blogifier.Web.dll"]
in Dockerfile. Also, I noticed that in the dotnet publish screenshot the dll name is SampleWebApi.dll notBlogifier.Web.dll
so please ensure that dll name is correct