Open Closed

Need advice for deploying MVC monolith (or other dotnet flavours) to production via docker image #941


0
[email protected] created
  • ABP Framework version: v4.2.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): MVC .Web proj
  • Exception message and stack trace:
  • Steps to reproduce the issue:

I am having a REALLY hard time getting a new ABP proj to run on anything other than local DEV in Visual Studio debugger. I can build an individual dockerfile and run it locally too but what I am TRYING to do is have a secure multi-tiered swarm of containers in a simple docker-compose.yml file.

There seems to be a lot of gotchas around getting reverse proxy to work with ASP and IdentityServer. I have spent 40h trying to get a working app to run on a hosting platform with live SSL certs.

Is there any clear, straightforward, up-to-date information on how to deploy ABP to a cloud environment via docker?

  • preferrably not to Azure as the budget doesn't really allow for THAT
  • I was planning on a one-click Docker Host deploy from Vultr or DigitalOcean b/c that's more my price-range, then just remote docker commands to rebuild/deploy
  • Needs to support certs (ie, lets encrypt via certbot)
  • Don't care what reverse proxy is used I just don't think the Kestrel container should be exposed directly (prove me wrong?)
  • I'd like to have a seamless DEV experience so multiple devs can contribute code, build locally, test on server and deploy to live easily (which is why the docker route)

I have looked into the Microservices sample, and have been toying with getting that running, then adding in modules and apps via ABP Suite. Ultimately I am trying to have a seamless, robust DEV -> PROD workflow including CI + CD.

These are the guides and intel I have been referring to while trying to make this work:

https://support.abp.io/QA/Questions/908/ABP-app-deployed-with-reverse-proxy-is-using-http-for-authorisation-URL-instead-of-https https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-5.0 https://support.abp.io/QA/Questions/790/Containerised-Deployment---Docker-Compose https://codeburst.io/load-balancing-an-asp-net-core-web-app-using-nginx-and-docker-66753eb08204 https://docs.docker.com/engine/examples/dotnetcore/

Guides I'm basically following, but trying to add SSL via reverse proxy (nginx) https://aspnetboilerplate.com/Pages/Documents/Articles/Running-in-Docker-Containers-and-Building-a-Web-Farm-Load-Balancer-Scenario/index.html#module-zero-core-template-web-farm-on-docker-with-using-redis-and-haproxy https://volosoft.com/blog/Docker-Web-Farm-Example-with-Using-Redis,-Ha-proxy-and-ASP.NET-C

Details on the ABP project itself: was a new application template i spun up, added an entity and ran just fine


2 Answer(s)
  • 0
    [email protected] created

    oh, and since there's no guide (unless someone points me to it!) then I propose that I submit an article on the community site with the steps/solution... 🤗

  • 0
    gterdem created
    Support Team

    I am having a REALLY hard time getting a new ABP proj to run on anything other than local DEV in Visual Studio debugger. I can build an individual dockerfile and run it locally too but what I am TRYING to do is have a secure multi-tiered swarm of containers in a simple docker-compose.yml file.

    There seems to be a lot of gotchas around getting reverse proxy to work with ASP and IdentityServer. I have spent 40h trying to get a working app to run on a hosting platform with live SSL certs.

    When you are writing the multi-layered Dockerfile, you need to copy NuGet.Config with your .csproj since abp commercial application is using private nuget source. Other than that, it's pretty default to an .net 5 application.

    Most of the time, gotchas are related with identityserver and i agree that identityserver on production is somewhat more complex and has more points to take care of comparing to local development because of certification, load balancing etc. But you can find more related questions and answer in stackoverflow or identityserver repo since it is directly related with it.

    Is there any clear, straightforward, up-to-date information on how to deploy ABP to a cloud environment via docker?

    We're planning to write down a guide from start to deployment to cloud (probably azure) for microservice template. You are always welcome to submit an article for the community since we won't be able to cover all the scenarios or cloud providers.