{"id":807,"date":"2020-06-24T08:30:00","date_gmt":"2020-06-24T05:30:00","guid":{"rendered":"http:\/\/localhost\/bilisimkurdu\/?p=807"},"modified":"2020-06-24T08:30:00","modified_gmt":"2020-06-24T05:30:00","slug":"asp-net-core-uygulamasini-heroku-ile-ucretsiz-yayinlamak","status":"publish","type":"post","link":"http:\/\/localhost\/bilisimkurdu\/asp-net-core-uygulamasini-heroku-ile-ucretsiz-yayinlamak\/","title":{"rendered":"ASP.NET Core Uygulamas\u0131n\u0131 Heroku ile \u00dccretsiz Yay\u0131nlamak"},"content":{"rendered":"\n
Merhaba Muhterem Ziyaret\u00e7ilerimiz,<\/p>\n\n\n\n
Bu yaz\u0131mda Heroku ile .NET CORE Web uygulamas\u0131na nas\u0131l yay\u0131mlanaca\u011f\u0131n\u0131 anlatmaya \u00e7al\u0131\u015faca\u011f\u0131m.<\/p>\n\n\n\n
Visual Studio \u00fczerinden haz\u0131rlanm\u0131\u015fsa:<\/p>\n\n\n\n
“%UserProfile%\\kullaniciAdi\\source\\repos\\projeAdi\\projeAdi” klas\u00f6r\u00fcne Dockerfile ve .circlei klas\u00f6r\u00fcn\u00fc ekliyoruz.<\/p>\n\n\n\n\n\n\n\n
Dockerfile<\/strong> i\u00e7eri\u011fi<\/p>\n\n\n\n .circleci\\config.yml<\/strong> i\u00e7eri\u011fi<\/p>\n\n\n\n de\u011ferleri ile yaz\u0131ld\u0131ktan sonra github ile pushlay\u0131p heroku uygulamas\u0131 ve circleci projesi olu\u015fturuyoruz.<\/p>\n\n\n\n CircleiCI projesi olu\u015fturuken resimdeki gibi uyguluyoruz.<\/p>\n\n\n\nFROM mcr.microsoft.com\/dotnet\/core\/sdk:3.1 AS build-env\nWORKDIR \/app\n\n# Copy csproj and restore as distinct layers\nCOPY *.csproj .\/\nRUN dotnet restore\n\n# Copy everything else and build\nCOPY . .\/\nRUN dotnet publish -c Release -o out\n\n# Build runtime image\nFROM mcr.microsoft.com\/dotnet\/core\/aspnet:3.1\nWORKDIR \/app\nCOPY --from=build-env \/app\/out .\nCMD ASPNETCORE_URLS=http:\/\/*:$PORT .\/projeAdi<\/code><\/pre>\n\n\n\n
version: 2\njobs:\n build:\n machine: true\n steps:\n - checkout \n\n # build image\n - run: | \n docker info\n docker build -t aspnetapp -f Dockerfile .\n # deploy the image\n - run: | \n docker login --username=$HEROKU_USERNAME --password=$HEROKU_API_KEY registry.heroku.com\n docker tag aspnetapp registry.heroku.com\/$HEROKU_APP_NAME\/web\n docker push registry.heroku.com\/$HEROKU_APP_NAME\/web \n curl https:\/\/cli-assets.heroku.com\/install.sh | sh\n heroku container:release web -a $HEROKU_APP_NAME<\/code><\/pre>\n\n\n\n