diff --git a/MVC/Dockerfile b/MVC/Dockerfile index daed97e..046262b 100644 --- a/MVC/Dockerfile +++ b/MVC/Dockerfile @@ -13,4 +13,13 @@ RUN dotnet publish -c Release -o out FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 WORKDIR /app COPY --from=build-env /app/out . + +RUN groupadd -g 500 dotnet && \ + useradd -u 500 -g dotnet dotnet \ + && chown -R dotnet:dotnet /app + +USER dotnet:dotnet + +ENV ASPNETCORE_URLS http://*:5000 + ENTRYPOINT ["dotnet", "MVC.dll"] \ No newline at end of file diff --git a/MVC/appsettings.Production.json b/MVC/appsettings.Production.json index 8034a90..10e16d0 100644 --- a/MVC/appsettings.Production.json +++ b/MVC/appsettings.Production.json @@ -7,6 +7,6 @@ } }, "ConnectionStrings": { - "DefaultConnection": "Server=db;Database=master;User=sa;Password=Testpassword123;MultipleActiveResultSets=true" + "DefaultConnection": "Server=db;Database=master;User=sa;Password=3XSsBjPkcnfR;MultipleActiveResultSets=true" } } diff --git a/MVC/docker-compose.yml b/MVC/docker-compose.yml index 2233f62..5947c5a 100644 --- a/MVC/docker-compose.yml +++ b/MVC/docker-compose.yml @@ -5,7 +5,7 @@ services: environment: ASPNETCORE_ENVIRONMENT: "Production" ports: - - "8000:80" + - "8080:5000" depends_on: - db networks: @@ -15,19 +15,19 @@ services: image: "mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04" restart: always environment: - MSSQL_SA_PASSWORD: "Testpassword123" - SA_PASSWORD: "Testpassword123" + MSSQL_SA_PASSWORD: "3XSsBjPkcnfR" + SA_PASSWORD: "3XSsBjPkcnfR" ACCEPT_EULA: "Y" ports: - - 1433:1433 + - "1433" volumes: - linuxaspnetcoredata:/var/opt/mssql networks: - linuxaspnetcore - + volumes: - linuxaspnetcoredata: + linuxaspnetcoredata: networks: - linuxaspnetcore: - driver: bridge \ No newline at end of file + linuxaspnetcore: + driver: bridge