Skip to content

Commit

Permalink
Removed root from web container
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaprawa committed May 23, 2020
1 parent c12a42d commit ab060d8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions MVC/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion MVC/appsettings.Production.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
16 changes: 8 additions & 8 deletions MVC/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
environment:
ASPNETCORE_ENVIRONMENT: "Production"
ports:
- "8000:80"
- "8080:5000"
depends_on:
- db
networks:
Expand All @@ -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
linuxaspnetcore:
driver: bridge

0 comments on commit ab060d8

Please sign in to comment.