Hi
I am using docker desktop(Linux container) in my windows laptop. I deployed a small asp .net core application with Sql Server database.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 443
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["MvcMovie/MvcMovie.csproj", "MvcMovie/"]
RUN dotnet restore "MvcMovie/MvcMovie.csproj"
COPY . .
WORKDIR "/src/MvcMovie"
RUN dotnet build "MvcMovie.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "MvcMovie.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MvcMovie.dll"]
docker-compose.yml
version: '3.4'
networks:
demoMovieNet:
services:
mvcmoviedata:
container_name: mvc-movie-data-app
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 8002:1433
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=password@12345#
- MSSQL_PID=Developer
networks:
- demoMovieNet
mvcmovie:
container_name: mvc-movie-app
image: ${DOCKER_REGISTRY-}mvcmovie
build:
context: .
dockerfile: MvcMovie/Dockerfile
ports:
- 8003:80
depends_on:
- mvcmoviedata
environment:
- DB_HOST=mvcmoviedata
- DB_NAME=myMovie
- DB_SA_PASSWORD=password@12345#
networks:
- demoMovieNet
i exported 443, 80 in my docker file. I mapper container port 80 with host port 8003. I did-not map any port for 443. After deployment in docker (docker compose up -d), i never access using the url
http://localhost:8003 , it seems like it is redirected to https without port(https://localhost), then it show 404 not found . why it is redirecting to https without port?
i can access the https url with port 55778 easily
What is the thing i am missing? Please let me know
Best Regards
Sabbir