Browse Source

Minor changes - Working docker-compose up on Docker Linux

pull/49/merge
Cesar De la Torre 8 years ago
parent
commit
b28d37ce97
8 changed files with 64 additions and 60 deletions
  1. +0
    -2
      docker-compose.yml
  2. +1
    -11
      src/Console/eShopConsole/Program.cs
  3. +41
    -0
      src/Services/Ordering/Ordering.API/.vscode/launch.json
  4. +16
    -0
      src/Services/Ordering/Ordering.API/.vscode/tasks.json
  5. +0
    -44
      src/Services/Ordering/Ordering.API/Controllers/ValuesController.cs
  6. +2
    -0
      src/Services/Ordering/Ordering.API/Dockerfile
  7. +1
    -0
      src/Services/Ordering/Ordering.API/Program.cs
  8. +3
    -3
      src/Services/Ordering/Ordering.API/project.json

+ 0
- 2
docker-compose.yml View File

@ -26,8 +26,6 @@ services:
image: eshop/ordering.api
environment:
- ConnectionString=TBD
expose:
- "80"
ports:
- "81:80"
extra_hosts:


+ 1
- 11
src/Console/eShopConsole/Program.cs View File

@ -62,19 +62,9 @@ namespace eShopConsole
.Include(o => o.ShippingAddress)
.Include(o => o.BillingAddress)
.ToList();
//Could be using .Load() if you don't want to create a List
//OTHER SAMPLE
//var company = context.Companies
// .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Car)
// .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Country)
// .FirstOrDefault(co => co.companyID == companyID);
//Assert when running test with a clean In-Memory DB
//Assert.Equal(1, context.Orders.Count());
string cityName = orders.First<Order>().ShippingAddress.City;
Console.WriteLine(cityName);
Console.WriteLine("City name retreived from SQL Server: "+cityName);
}
}
}


+ 41
- 0
src/Services/Ordering/Ordering.API/.vscode/launch.json View File

@ -0,0 +1,41 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.0\\Ordering.API.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command.pickProcess}"
}
]
}

+ 16
- 0
src/Services/Ordering/Ordering.API/.vscode/tasks.json View File

@ -0,0 +1,16 @@
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
"${workspaceRoot}\\project.json"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}

+ 0
- 44
src/Services/Ordering/Ordering.API/Controllers/ValuesController.cs View File

@ -1,44 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
{
// GET api/values
[HttpGet]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("{id}")]
public string Get(int id)
{
return "value";
}
// POST api/values
[HttpPost]
public void Post([FromBody]string value)
{
}
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
}

+ 2
- 0
src/Services/Ordering/Ordering.API/Dockerfile View File

@ -2,6 +2,8 @@
# Other .NET images
# FROM microsoft/dotnet:1.0.0-preview2-sdk
# FROM microsoft/dotnet:1.0.0-core
# FROM microsoft/aspnetcore
# FROM microsoft/dotnet:1.0.0-preview2-windowsservercore-sdk
WORKDIR /app
EXPOSE 80


+ 1
- 0
src/Services/Ordering/Ordering.API/Program.cs View File

@ -17,6 +17,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
//.UseUrls("http://localhost:5555") //Just for KESTREL
.Build();
host.Run();


+ 3
- 3
src/Services/Ordering/Ordering.API/project.json View File

@ -17,10 +17,10 @@
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0",
"Ordering.Domain": "1.0.0-*",
"Ordering.SqlData": "1.0.0-*",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0"
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Ordering.Domain": "1.0.0-*",
"Ordering.SqlData": "1.0.0-*"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",


Loading…
Cancel
Save