Based on
- More about .NET Core
- ASP.NET Core
- Entity Framework Core
- HOSTING .NET CORE ON LINUX WITH DOCKER - A NOOB'S GUIDE
- Microsoft/dotnet docker image
- Clone or download this repository to local machine.
- Install Docker for your platform if didn't install yet.
cd SampleWebApiNetCore/src/SampleWebApiNetCore
- Create dbsettings.json - see more below
sudo docker build -t enter-name-your-docker-container .
sudo docker run -p 5000:5000 -it enter-name-your-docker-container
orsudo docker run -p 5000:5000 -d enter-name-your-docker-container
to run detached.
- Clone or download this repository to local machine.
- Install .NET Core SDK for your platform if didn't install yet.
cd SampleWebApiNetCore/src/SampleWebApiNetCore
- Create dbsettings.json - see more below
dotnet restore
dotnet run
- Install Visual Studio 2015 for your platform if didn't install yet.
- Install Visual Studio 2015 Tools (Preview 2) if didn't install yet.
- Visual Studio tools include .NET Core 1.0.1. You need to also install .NET Core 1.1 SDK to add support the .NET Core 1.1 if didn't install yet.
- Open project
- Create dbsettings.json - see more below
- Debug -> Start debugging
- Create file
dbsettings.json
into SampleWebApiNetCore/src/SampleWebApiNetCore with right settings(host/login/password and etc.)
{
"ConnectionStrings": {
"DefaultConnection": "User ID=your-user;Password=your-password;Host=your-host;Port=5432;Database=your-db-name;Pooling=true;"
}
}