Asp.Net Core 2.2 Docker HTTPS issue

I have a problem when I’d like to run my app (Asp.Net Core 2.2) under a docker.

Firstly, I created a self-signed certificate using:

dotnet dev-certs https -v -ep d:tempcert-aspnetcore.pfx -p ufo

after that, I copied to cert-aspnetcore.pfx to C:UsersMyUsername.aspnethttps location

Here’s my docker-compose.yml

version: '3.4'

services:
  testapi.api:
    image: ${DOCKER_REGISTRY-}testapi
    build:
      context: .
      dockerfile: TestApi.Api/Dockerfile

and docker-compose.override.yml

> version: '3.4'
> 
> services:   testapi.api:
>     environment:
>       - ASPNETCORE_ENVIRONMENT=Development
>       - ASPNETCORE_URLS=https://+:443;http://+:80
>       - ASPNETCORE_HTTPS_PORT=44395
>       - ASPNETCORE_Kestrel__Certificates__Default__Password=ufo
>       - ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/cert-aspnetcore.pfx
>     ports:
>       - "9000:80"
>       - "44395:443"
>     volumes:
>       - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro
>       - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro

But when I try to run docker-compose up –build I get:

crit: Microsoft.AspNetCore.Server.Kestrel[0] Unable to start Kestrel.
System.InvalidOperationException: Unable to configure HTTPS endpoint.
No server certificate was specified, and the default developer
certificate could not be found.

If you need any information please let me know. Many thanks!

Source: StackOverflow