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.

This commit is contained in:
Cesar De la Torre 2016-09-14 21:37:48 -07:00
parent e60e65ab0d
commit 9ede5f0522
6 changed files with 36 additions and 24 deletions

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"

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 ADD . /app
EXPOSE 80/tcp # COPY . /app
# Copy the app # Entry point through the copied assembly
COPY . /app 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

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");

View File

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

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);

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);