It's my first time using Docker and im trying to run an image but i need it to work on the port 4242, but when i write the command sudo docker run -it --rm -p 4242:5001 docker-project:v1
and when i go to https://localhost:4242/weatherforecast with my launcher i have nothing, it keeps working with the port 5001 and i want it to work in the port 4242.
There is my docker file if it can help
FROM mcr.microsoft.com/dotnet/aspnet:3.1-focal AS base
WORKDIR /app
EXPOSE 5000
ENV ASPNETCORE_URLS=http://+:5001
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
FROM mcr.microsoft.com/dotnet/sdk:3.1-focal AS build
WORKDIR /src
COPY ["dockerProject.csproj", "./"]
RUN dotnet restore "dockerProject.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "dockerProject.csproj" -c Release -o /app/buil
FROM build AS publish
RUN dotnet publish "dockerProject.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "dockerProject.dll"]