/AspNet.Docker.Integration

This project is built using ASP.NET Core 2.1. The target is learning ASP.NET core with Dependency injection(Autofac) using repository pattern and technique of Docker.

Primary LanguageC#

This project is deprecated!

AspNet.Docker.Integration

Build status

This project is built using ASP.NET Core 2.2.
The target is learning ASP.NET core with Dependency injection(Autofac) using repository pattern and technique of Docker.

Build Setup

Clone this project by

git clone https://github.com/shengLin-alex/AspNet.Docker.Integration.git

Go to web project folder

cd ./AspNet.Docker.Integration/AspNet.Docker.Integration

Then docker-compose up

docker-compose up

Rebuild netcore service

docker-compose build netcore

docker-compose up

.env example

APP_HOST_PORT=8001

# The persistent database data folder must be put outside of solution folder
POSTGRES_HOST_DIR=../../db_data/postgres_data
POSTGRES_DB=develop
POSTGRES_USER=dockeradmin
POSTGRES_PASSWORD=dockeradmin
POSTGRES_PORT=5432

# The persistent database data folder must be put outside of solution folder
SQLSERVER_HOST_DIR=../../db_data/sqlserver_data
SQLSERVER_PORT=1433
SQLSERVER_PASSWORD=dockERadmin_1

Simple Test with RESTful API

POST /api/test/user, with body:

{
  "name": "John Doe"
}

GET /api/test/users, the response will show:

[
  {
    "id": 1,
    "name": "John Doe"
  }
]