I have a couple of docker images, they run fine apart from the ports are always 5000 (the default, on asp.net core), no matter what I do they are not changing, any ideas, how to fix or debug this further?
Containers running on Linux (Debian 9) Hosted on Linode
Starting the build with
docker-compose -f docker-compose.yml up
Docker-compose.yml
#Api  Service
API:
 build:
  context: .
  #Use the DockerFile in that Directory
  dockerfile: Dockerfile
  #This Service Depends on the database service specifed above
  depends_on:
  - database
#Map port 8888 in the docker container to port 80 in the Api
ports:
  - "5000:80"
restart: always
#Specify Environment Variables for the Api Service
environment:
  - DBHOST=database
  - ASPNETCORE_ENVIRONMENT=Production
DockerFile
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80/tcp
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["TestApi.csproj", "./"]
RUN dotnet restore "TestApi.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "TestApi.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "TestApi.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TestApi.dll"]
docker-compose.debug.yml
version: '3.4'
services:
  testapi:
    image: testapi
    build:
      context: .
      dockerfile: ./Dockerfile
    ports:
      - 80
      - 5000
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
      - ASPNETCORE_URLS=http://+:80
    volumes:
      - ~/.aspnet/https:/https:ro