Skip to content

jcesarmm/core-microservices-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisite:

Database

If you want to use your local database then Execute Database script "/sql/Coreservice.sql" :

  • It will create coreservices databse with required tables and sps
  • Update connection string with your database connections.

NewRelic

  • Case1: If you donot want to use NewRelic then comment below three lines in DockerFile : ../src/Core.Services/Dockerfile :
  1. ARG NewRelic=./newrelic
  2. COPY $NewRelic ./newrelic
  3. RUN dpkg -i ./newrelic/newrelic-netcore20-agent*.deb
  • Case2: In you want to use NewRelic monitoring:
    • Download below from http://download.newrelic.com/dot_net_agent/core_20/current
      1. newrelic-netcore20-agent_8.0.0.0_amd64.deb
    • Create a folder named "newrelic" inside ../src/Core.Services
    • Add below line in .dockerignore file : !newrelic
    • Register into Newrelic and get NEW_RELIC_LICENSE_KEY
    • Replace this NEW_RELIC_LICENSE_KEY value in dockerfile

Run application using below steps:

  • Open command promt and go to ../src/Core.Services
  • dotnet restore
  • dotnet build
  • dotnet publish -o obj/Docker/publish
  • docker build -t coreimage .
  • See images using command "docker images",it will list your image "coreimage" also
  • docker run -d -p 28601:8601 --name core1 --env ASPNETCORE_ENVIRONMENT=QA coreimage
    1. d => detached mode
    2. p => host protocol and here you will acees api by localhost:28601
    3. name => container name
    4. env => Environmentname like QA/Development/Staging/PROD for running transformation
  • See conatainers running using command "docker ps",it will lsit your container "core1" also

Access Apis

Check Kitematic for logs

To see NewRelic logs

  • Run docker image with NewRelic app name docker run -d -p 28601:8601 --name core1 --env ASPNETCORE_ENVIRONMENT=QA coreimage --env NEW_RELIC_APP_NAME=CoreServiceApp
  • Go to newrelic and click on Application and select your app "CoreServiceApp"

Run Unit Tests

  1. Open command prompt and go to unit test project : ../src/Core.Services.Tests.Unit
  2. run tests using command : dotnet test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 72.4%
  • JavaScript 25.4%
  • Gherkin 2.2%