AspNetCorePostgreSQLDockerApp
ASP.NET Core with PostgreSQL Docker App Demo
Install / Use
/learn @DanWahlin/AspNetCorePostgreSQLDockerAppREADME
ASP.NET Core with PostgreSQL and Docker Demo
Application demo designed to show how ASP.NET Core and PostgreSQL can be run in Docker containers. The app uses Entity Framework to create a simple database that stores Docker commands and examples. It also shows how Angular can be integrated with Web API to display customer information.
Running the App with Docker Compose
-
Install
Docker Desktop for MacorDocker Desktop for Windows. -
Navigate to the
AspNetCorePostgreSQLDockerAppsubfolder in a console window. -
Open the
Clientfolder in a terminal window and run the following commands at the root of the folder (requires Node.js):npm installnpm install -g @angular/cling build
-
Move back up a level to the
AspNetCorePostgreSQLDockerAppin the terminal window:-
Run
docker-compose build -
Run
docker-compose up
-
-
Navigate to http://localhost:5000 in your browser to view the site.
Using the Web App for Container Services on Azure
- Run
docker-compose -f docker-compose.prod.yml build. - Tag the
aspnetcoreappimage as[yourDockerHubUserAccount]/aspnetcoreapp. Make sure you substitute your Docker Hub user account for[yourDockerHubUserAccount]. - Push the image to Docker Hub using
docker push [yourDockerHubUserAccount]/aspnetcoreapp. - Open
docker-compose azure.ymlfile and change the image for thewebservice to[yourDockerHubUserAccount]/aspnetcoreapp. - Create a new
Web App for Containersservice in Azure. You'll need to add it to a new or existing Resource Group. - On the
Dockertab, switchOptionstoDocker Compose,Image SourcetoDocker Huband upload thedocker-compose azure.ymlfile using theConfiguration Filesection of the screen. - Wait for the service to start (it may take a few minutes to pull the image and fire up the Web App Service) and then click the web link it provides in the
Overviewsection to hit the app.
