Browse Source

Ordering.API integrated and working now on the solutions's docker-compose.yml. Also created an independent docker-compose.yml for the Ordering.API microservice to deploy and test in isolation.

pull/49/merge
Cesar De la Torre 8 years ago
parent
commit
9ede5f0522
6 changed files with 36 additions and 24 deletions
  1. +14
    -1
      docker-compose.yml
  2. +14
    -14
      src/Services/Ordering/Ordering.API/Dockerfile
  3. +1
    -1
      src/Services/Ordering/Ordering.API/Startup.cs
  4. +5
    -6
      src/Services/Ordering/Ordering.API/docker-compose.yml
  5. +1
    -1
      src/Services/Ordering/Ordering.SqlData/UnitOfWork/DBContextUtil.cs
  6. +1
    -1
      src/Services/Ordering/Ordering.SqlData/UnitOfWork/OrderingDbContext.cs

+ 14
- 1
docker-compose.yml View File

@ -9,6 +9,7 @@ services:
- "80:80" - "80:80"
depends_on: depends_on:
- catalog.api - catalog.api
catalog.api: catalog.api:
image: eshop/catalog.api image: eshop/catalog.api
environment: environment:
@ -17,5 +18,17 @@ services:
- "80" - "80"
depends_on: depends_on:
- catalogdata - catalogdata
catalogdata: catalogdata:
image: glennc/eshopdata
image: glennc/eshopdata
ordering.api:
image: eshop/ordering.api
environment:
- ConnectionString=TBD
expose:
- "80"
ports:
- "81:80"
extra_hosts:
- "CESARDLBOOKVHD:10.0.75.1"

+ 14
- 14
src/Services/Ordering/Ordering.API/Dockerfile View File

@ -1,30 +1,30 @@
FROM microsoft/dotnet:1.0.0-preview2-sdk
FROM microsoft/aspnetcore
# Other .NET images
# FROM microsoft/dotnet:1.0.0-preview2-sdk
# FROM microsoft/dotnet:1.0.0-core
#Lighter image if copying the compiled app and entrypoint as ENTRYPOINT dotnet Ordering.API.dll
#FROM microsoft/dotnet:1.0.0-core
# Set the Working Directory
WORKDIR /app WORKDIR /app
EXPOSE 80
# Configure the listening port to 80 # Configure the listening port to 80
ENV ASPNETCORE_URLS http://*:80
# ENV ASPNETCORE_URLS http://*:80
# Open port exposed by Docker
EXPOSE 80/tcp
ADD . /app
# COPY . /app
# Copy the app
COPY . /app
# Entry point through the copied assembly
ENTRYPOINT dotnet Ordering.API.dll
################# #################
# Entry point running the SDK --> Requires heavy Docker .NET image, not for production
# Restore NuGet packages # Restore NuGet packages
#RUN ["dotnet", "restore"] #RUN ["dotnet", "restore"]
# Build the .NET Core app # Build the .NET Core app
#RUN ["dotnet", "build"] #RUN ["dotnet", "build"]
# Entrypoint # Entrypoint
#ENTRYPOINT ["dotnet", "run"] #ENTRYPOINT ["dotnet", "run"]
################# #################
# Entry point through the copied assembly
ENTRYPOINT dotnet Ordering.API.dll

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

@ -46,7 +46,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
//var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;Trusted_Connection=True;"; //var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;Trusted_Connection=True;";
//(SQL Server Authentication) //(SQL Server Authentication)
var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;";
var connString = @"Server=10.0.75.1;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;";
//(TBD) connString = config.GetConnectionString("SqlStandardAuthentication.OrderingDb"); //(TBD) connString = config.GetConnectionString("SqlStandardAuthentication.OrderingDb");


+ 5
- 6
src/Services/Ordering/Ordering.API/docker-compose.yml View File

@ -1,12 +1,11 @@
version: '2' version: '2'
services: services:
microsoft.eshoponcontainers.services.ordering.api:
image: username/microsoft.eshoponcontainers.services.ordering.api
build:
context: .
dockerfile: Dockerfile
ordering.api:
image: eshop/ordering.api
environment:
- ConnectionString=TBD
ports: ports:
- "80:80"
- "81:80"
extra_hosts: extra_hosts:
- "CESARDLBOOKVHD:10.0.75.1" - "CESARDLBOOKVHD:10.0.75.1"

+ 1
- 1
src/Services/Ordering/Ordering.SqlData/UnitOfWork/DBContextUtil.cs View File

@ -39,7 +39,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.SqlData.UnitOfWork
//(Integrated Security) var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;Trusted_Connection=True;"; //(Integrated Security) var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;Trusted_Connection=True;";
//(SQL Server Authentication) //(SQL Server Authentication)
var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;";
var connString = @"Server=10.0.75.1;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;";
//SQL LOCALDB //SQL LOCALDB
builder.UseSqlServer(connString); builder.UseSqlServer(connString);


+ 1
- 1
src/Services/Ordering/Ordering.SqlData/UnitOfWork/OrderingDbContext.cs View File

@ -31,7 +31,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.SqlData.UnitOfWork
//var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;Trusted_Connection=True;"; //var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;Trusted_Connection=True;";
//(SQL Server Authentication) //(SQL Server Authentication)
var connString = @"Server=CESARDLBOOKVHD;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;";
var connString = @"Server=10.0.75.1;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;";
//SQL LOCALDB //SQL LOCALDB
optionsBuilder.UseSqlServer(connString); optionsBuilder.UseSqlServer(connString);


Loading…
Cancel
Save