Open Closed

New Docker support added (Docker compose) #8864


User avatar
0
improwise created

As the previous thread was closed, I create a new one regarding the now re-added Docker (Docker compose) support in ABP Commercial to follow up on improvements and possible problems. Probably a good idea to keep it all in one place rather than creating different tickets for everything (hopefully it won't be much but you never know). Please refund this ticket as the previous one was closed and can not be reopened it seems.

https://abp.io/support/questions/8082/What-is-the-support-for-Docker-in-ABP-Commercial-today


21 Answer(s)
  • User Avatar
    0
    improwise created

    There is a small bug in the build-images-locally.ps1 file, at least for Angular:

    Write-Host "********* BUILDING Angular Application *********" -ForegroundColor Green $angularAppFolder = Join-Path $slnFolder "../angular"

    This should be ./angular with only one dot as above it, you already have the lines

    $currentFolder = $PSScriptRoot $slnFolder = Join-Path $currentFolder "../../"

    Or the script wont find the folder (at least assuming you follow the instructions "Navigate to etc/docker-compose folder and run the build-images-locally.ps1 ").

  • User Avatar
    0
    improwise created

    docker-compose.yml still uses

    version: '3.8'

    which is deprecated (the version attribute that is)

  • User Avatar
    0
    improwise created

    Some other improvements

    1. User SQL Server 2022 instead of 2019 unless there are a good reason for it

    2. User "docker compose" rather than "docker-compose"

    3. Probably some other dependencies like Redis etc that should be updated to newer/latest version

  • User Avatar
    0
    improwise created

    The health check for SQL server in YAML file will fail

    healthcheck:
    test: /opt/mssql-tools/bin/sqlcmd -S sql-server -U sa -P "myPassw0rd" -Q "SELECT 1" -b -o /dev/null

    This both because the sqlcmd seem to have moved to /opt/mssql-tools18/bin/sqlcmd and also as i lacks the -C to accept self signed certificates.

    https://github.com/testcontainers/testcontainers-dotnet/issues/1220

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Thanks, we will improve it.

  • User Avatar
    0
    improwise created

    The Docker files (ie not Docker.local) are not recognized by Visual Studio, probably because they are not added to the project in the correct way. This means that the Docker functionality in Visual Studio isn't there for publishing etc. as to VS, there exist no Docker files. While you can of course to this yourself, I think it would be nice if it was setup correctly from start, not sure how much extra work it would mean though to get it working with Docker Compose etc.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I think using a script is more convenient than using Visual Studio, but I'll take a look.

  • User Avatar
    0
    improwise created

    I think using a script is more convenient than using Visual Studio, but I'll take a look.

    Yes, agreed, but with the "Docker" file being there, it would be good if it was setup for VS. Not sure if that file is actually ever used or just the Docker.local?

  • User Avatar
    0
    improwise created

    It seems like the docker compose is setup to create and use a Redis image even when redis is in fact not used in the project. Might not be a problem locally but could be if you deploy to something like Azure and creates a Regis container thinking it is needed when it is not. Maybe this should at least be highlighted in some way as it is probably a good idea to include the redis image as well in the base setup.

    On a side note, I was a bit surprised to learn that for new ABP 9 projects, redis does not seem to get installed or configured unless you add the Public Web site, is this true and if so, is that a change from previous or has it always been like that?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I will check it

  • User Avatar
    0
    improwise created

    It seems like the template creates the wrong path to DBMigrator Dockerfile.local in the YAML

    coin-api:
    image: improwise/coin-api:latest
    container_name: coin-api
    hostname: coin-api
    build:
    context: ../../
    dockerfile: src/ImproWise.COIN.HttpApi.Host/Dockerfile.local

    db-migrator:
    image: improwise/coin-db-migrator:latest
    container_name: db-migrator
    build:
    context: ../../
    dockerfile: src/COIN.DbMigrator/Dockerfile.local

  • User Avatar
    0
    improwise created

    The docker-compose.yml build paths seem to be wrong making the image build not working (unless you have built the images before). Problem seem to be that if you execute the run-docker script in the docker-compose folder (which I assume most would), it wont find the dockerfile.local files, or rather, the dockerfile.local files wont find what they need.

    For it to work, you would need to change the build for relevant images from (for API) to something like this. This of course assumes that the release/publish folder already exist

    build:
    context: ../../
    dockerfile: src/ImproWise.COIN.HttpApi.Host/Dockerfile.local

    To

    build:
    context: ../../src/ImproWise.COIN.HttpApi.Host
    dockerfile: Dockerfile.local

    This problem is kind of masked if you run the build-images-locally script first as that would mean the images were already available, but I believe that this should still be changed so that the docker-compose can run on its own (at least assuming the publish folder is there but that is perhaps a more reasonable expectation).

    Thanks.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    okay : )

  • User Avatar
    0
    improwise created

    Is the dynamic-env.json file even used for NON Docker setups?

    From what I can see in environemnt.prod.ts, ABP relies on NGINX being setup und running and responding to /getEnvConfig but how would that happen unless you are using Docker (or configure nxinx manually). This however from what I can see is never mentioned in the docs nor the files nginx.conf or dynamic-env.json. There also now does not seem to be an option to not create support for Docker Compose so I imagine those files will always be there, along with this

    remoteEnv: {
    url: '/getEnvConfig',
    mergeStrategy: 'deepmerge',
    },

    Assuming the above is true, I think it should at least be clearly mentioned that the remoteEnv requires Docker/Nginx. Or I am wrong which would probably be better for everyone :)

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    dynamic-env.json is not necessary
    getEnvConfig API request is related to RemoteEnvironment. You could remove the configuration if you didn't use it.
    https://abp.io/docs/latest/framework/ui/angular/environment#remoteenvironment

    It can work with any webserver , not just nginx.

  • User Avatar
    0
    improwise created

    Hi,

    dynamic-env.json is not necessary
    getEnvConfig API request is related to RemoteEnvironment. You could remove the configuration if you didn't use it.
    https://abp.io/docs/latest/framework/ui/angular/environment#remoteenvironment

    It can work with any webserver , not just nginx.

    But isn't the dynamic-env.json file there only to be overridden by the one in docker-compose folder (or rather on a mounted docker volume)? And the same probably goes for the nginx.conf file. If so, perhaps it should be highlighted more in the docs, as I think trying to setup something similar in a production environment, especially a managed one, would require different solutions (since you would probably not control the host to be able to modify the local docker-env.jsoin).

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I will check it and add to explanation README or delete it

  • User Avatar
    0
    improwise created

    Seriously, this service bot needs replacing :)

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    There is no need to keep this question open, I will leave a message here after it is finished

  • User Avatar
    0
    improwise created

    Hi,

    It was mainly while we continued to evaluate/use the Docker support ourselves but we have paused that for the moment anyway. Hopefully our findings can help improve the needed files for everyone.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Okay ,you can leave your reply anytime

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 19, 2025, 10:09