Skip to content

brych126/DotnetWebAppWithCompose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET

Linux containers on Windows host

  1. Clone the repo and navigate to its root folder
cd .\DotnetWebAppWithCompose\
  1. Generate cert and configure local machine:
mkdir -p $env:APPDATA\ASP.NET\Https
dotnet dev-certs https -ep $env:APPDATA\ASP.NET\Https\WebFrontEnd.pfx -p <CREDENTIAL_PLACEHOLDER>
dotnet dev-certs https --trust
  1. Configure application secrets, for the certificate:
dotnet user-secrets -p .\WebFrontEnd\WebFrontEnd.csproj set "Kestrel:Certificates:Development:Password" <CREDENTIAL_PLACEHOLDER>

Note

The password must match the password used for the certificate.

  1. Start services using docker compose:
docker compose up -d

Linux containers on Linux host

  1. Clone the repo and navigate to its root folder
cd DotnetWebAppWithCompose/
  1. Create a certificate directory with appropriate permissions:
mkdir -p -m 755 ~/.aspnet/https
mkdir -p -m 755 ~/.microsoft/usersecrets
  1. Generate cert and configure local machine:
dotnet dev-certs https -ep ~/.aspnet/https/WebFrontEnd.pfx -p <CREDENTIAL_PLACEHOLDER>
dotnet dev-certs https --trust
  1. Configure application secrets, for the certificate:
dotnet user-secrets -p ./WebFrontEnd/WebFrontEnd.csproj set "Kestrel:Certificates:Development:Password" <CREDENTIAL_PLACEHOLDER>

Note

The password must match the password used for the certificate.

  1. Change permissions for created files:
sudo chmod 755 -R  ~/.aspnet/
sudo chmod 755 -R  ~/.microsoft/
  1. Update .env file by replacing old value for COMPOSE_FILE env variable with new one COMPOSE_FILE=docker-compose.yml:docker-compose.override.yml:docker-compose.healthcheck.yml:docker-compose-linux.override.yml. docker-compose-linux.override.yml file has been added to the list of docker compose yaml files. It is needed because it contains overrides for certificate mount paths for linux host.
  2. Start services using docker compose:
docker compose up -d

Useful References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published