Start the solution with: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d Also, some clean-up.pull/114/head
@ -0,0 +1,76 @@ | |||
version: '2' | |||
# The Production docker-compose file has to have the external/real IPs or DNS names for the services | |||
# This configuration has to be used when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance. | |||
# ASPNETCORE_ENVIRONMENT=Development just to get errors while testing. Could be set to "Production" | |||
# | |||
# You need to start it with the following CLI command: | |||
# docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d | |||
services: | |||
basket.api: | |||
environment: | |||
- ASPNETCORE_ENVIRONMENT=Development | |||
- ASPNETCORE_URLS=http://0.0.0.0:5103 | |||
- ConnectionString=basket.data | |||
- identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. | |||
ports: | |||
- "5103:5103" | |||
catalog.api: | |||
environment: | |||
- ASPNETCORE_ENVIRONMENT=Development | |||
- ASPNETCORE_URLS=http://0.0.0.0:5101 | |||
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word | |||
- ExternalCatalogBaseUrl=http://192.168.88.248:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. | |||
ports: | |||
- "5101:5101" | |||
identity.api: | |||
environment: | |||
- ASPNETCORE_ENVIRONMENT=Development | |||
- ASPNETCORE_URLS=http://0.0.0.0:5105 | |||
- SpaClient=http://192.168.88.248:5104 | |||
- ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word | |||
- MvcClient=http://192.168.88.248:5100 #Local: You need to open your host's firewall at range 5100-5105. | |||
ports: | |||
- "5105:5105" | |||
ordering.api: | |||
environment: | |||
- ASPNETCORE_ENVIRONMENT=Development | |||
- ASPNETCORE_URLS=http://0.0.0.0:5102 | |||
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word | |||
- identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. | |||
ports: | |||
- "5102:5102" | |||
webspa: | |||
environment: | |||
- ASPNETCORE_ENVIRONMENT=Development | |||
- ASPNETCORE_URLS=http://0.0.0.0:5104 | |||
- CatalogUrl=http://192.168.88.248:5101 | |||
- OrderingUrl=http://192.168.88.248:5102 | |||
- IdentityUrl=http://192.168.88.248:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. | |||
- BasketUrl=http://192.168.88.248:5103 | |||
ports: | |||
- "5104:5104" | |||
webmvc: | |||
environment: | |||
- ASPNETCORE_ENVIRONMENT=Development | |||
- ASPNETCORE_URLS=http://0.0.0.0:5100 | |||
- CatalogUrl=http://catalog.api:5101 | |||
- OrderingUrl=http://ordering.api:5102 | |||
- IdentityUrl=http://192.168.88.248:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. | |||
- BasketUrl=http://basket.api:5103 | |||
ports: | |||
- "5100:5100" | |||
sql.data: | |||
environment: | |||
- SA_PASSWORD=Pass@word | |||
- ACCEPT_EULA=Y | |||
ports: | |||
- "5433:1433" |
@ -1,71 +0,0 @@ | |||
using System; | |||
using System.Linq; | |||
using Microsoft.eShopOnContainers.Services.Ordering.SqlData.UnitOfWork; | |||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel; | |||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Contracts; | |||
using Microsoft.eShopOnContainers.Services.Ordering.SqlData.Repositories; | |||
using Microsoft.EntityFrameworkCore; | |||
namespace eShopConsole | |||
{ | |||
public class Program | |||
{ | |||
public static void Main(string[] args) | |||
{ | |||
//// All contexts that share the same service provider will share the same database | |||
////Using InMemory DB | |||
////var options = DbContextUtil.CreateNewContextOptionsForInMemoryDB(); | |||
////Using Sql Server | |||
//var options = DbContextUtil.CreateNewContextOptionsForSqlDb(); | |||
//// Run the test against one instance of the context | |||
//using (var context = new OrderingDbContext(options)) | |||
//{ | |||
// IOrderRepository orderRepository = new OrderRepository(context); | |||
// //Create generic Address ValueObject | |||
// Address sampleAddress = new Address("15703 NE 61st Ct.", | |||
// "Redmond", | |||
// "Washington", | |||
// "WA", | |||
// "United States", | |||
// "US", | |||
// "98052", | |||
// 47.661492, | |||
// -122.131309 | |||
// ); | |||
// //Create sample Orders | |||
// Order order1 = new Order(Guid.NewGuid(), sampleAddress, sampleAddress); | |||
// //Add a few OrderItems | |||
// order1.AddNewOrderItem(Guid.NewGuid(), 2, 25, 30); | |||
// order1.AddNewOrderItem(Guid.NewGuid(), 1, 58, 0); | |||
// order1.AddNewOrderItem(Guid.NewGuid(), 1, 60, 0); | |||
// order1.AddNewOrderItem(Guid.NewGuid(), 3, 12, 0); | |||
// order1.AddNewOrderItem(Guid.NewGuid(), 5, 3, 0); | |||
// orderRepository.Add(order1); | |||
// orderRepository.UnitOfWork.CommitAsync(); | |||
// //With no Async Repository | |||
// //context.Orders.Add(order1); | |||
// //context.SaveChanges(); | |||
//} | |||
////// Use a separate instance of the context to verify correct data was saved to database | |||
//using (var context = new OrderingDbContext(options)) | |||
//{ | |||
// var orders = context.Orders | |||
// .Include(o => o.ShippingAddress) | |||
// .Include(o => o.BillingAddress) | |||
// .ToList(); | |||
// string cityName = orders.First<Order>().ShippingAddress.City; | |||
// Console.WriteLine("City name retreived from SQL Server: "+cityName); | |||
//} | |||
} | |||
} | |||
} |
@ -1,19 +0,0 @@ | |||
using System.Reflection; | |||
using System.Runtime.CompilerServices; | |||
using System.Runtime.InteropServices; | |||
// General Information about an assembly is controlled through the following | |||
// set of attributes. Change these attribute values to modify the information | |||
// associated with an assembly. | |||
[assembly: AssemblyConfiguration("")] | |||
[assembly: AssemblyCompany("")] | |||
[assembly: AssemblyProduct("eShopConsole")] | |||
[assembly: AssemblyTrademark("")] | |||
// Setting ComVisible to false makes the types in this assembly not visible | |||
// to COM components. If you need to access a type in this assembly from | |||
// COM, set the ComVisible attribute to true on that type. | |||
[assembly: ComVisible(false)] | |||
// The following GUID is for the ID of the typelib if this project is exposed to COM | |||
[assembly: Guid("c10c7b69-ce4f-4167-928e-33b7fa1dffc7")] |
@ -1,4 +0,0 @@ | |||
{ | |||
"profiles": { | |||
} | |||
} |
@ -1,18 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<PropertyGroup> | |||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | |||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | |||
</PropertyGroup> | |||
<PropertyGroup Label="Globals"> | |||
<ProjectGuid>c10c7b69-ce4f-4167-928e-33b7fa1dffc7</ProjectGuid> | |||
<RootNamespace>eShopConsole</RootNamespace> | |||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | |||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | |||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | |||
</PropertyGroup> | |||
<PropertyGroup> | |||
<SchemaVersion>2.0</SchemaVersion> | |||
</PropertyGroup> | |||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> | |||
</Project> |
@ -1,29 +0,0 @@ | |||
{ | |||
"version": "1.0.0-*", | |||
"buildOptions": { | |||
"emitEntryPoint": true, | |||
"debugType": "portable" | |||
}, | |||
"dependencies": { | |||
"Microsoft.EntityFrameworkCore": "1.0.0", | |||
"Microsoft.NETCore.App": { | |||
"type": "platform", | |||
"version": "1.0.0" | |||
}, | |||
"Ordering.Domain": "1.0.0-*", | |||
}, | |||
"frameworks": { | |||
"netcoreapp1.0": { | |||
"imports": "dnxcore50" | |||
} | |||
}, | |||
"publishOptions": { | |||
"include": [ | |||
"docker-compose.yml", | |||
"docker-compose.debug.yml", | |||
"Dockerfile.debug", | |||
"Dockerfile", | |||
".dockerignore" | |||
] | |||
} | |||
} |