i'm running my asp.net core application through systemd and nginx on linux and it works fine. I have tried to run it through a docker container but i'm getting an error when i use docker run -p 5000:5000 name-of-repo : Application startup exception: MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
which is weird because running through systemd or dotnet run doesnt give this error and the application works just fine. Am i missing some configuration in docker or something?
here is my dockerfile:
FROM microsoft/dotnet:latest
COPY . /app
WORKDIR /app
RUN dotnet restore
RUN dotnet build
EXPOSE 5000/tcp
ENV ASPNETCORE_URLS http://*:5000
ENV ASPNETCORE_ENVIRONMENT docker
ENTRYPOINT dotnet run
User contributions licensed under CC BY-SA 3.0