Skip to content

Commit

Permalink
Merge pull request #75 from rockfordlhotka/or22
Browse files Browse the repository at this point in the history
Updates from Orlando 2022
  • Loading branch information
rockfordlhotka authored Nov 15, 2022
2 parents c8c1080 + 6afeacd commit 402e493
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
3 changes: 2 additions & 1 deletion src/Lab03/End/Gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
Expand All @@ -19,4 +20,4 @@ RUN dotnet publish "Gateway.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Gateway.dll"]
ENTRYPOINT ["dotnet", "Gateway.dll"]
6 changes: 3 additions & 3 deletions src/Lab03/End/Gateway/Services/SandwichRequestor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public class SandwichRequestor : ISandwichRequestor
{
readonly IConfiguration _config;
readonly IWorkInProgress _wip;
readonly Policy _retryPolicy = Policy.
Handle<Exception>().
WaitAndRetry(3, r => TimeSpan.FromSeconds(Math.Pow(2, r)));
readonly Policy _retryPolicy = Policy
.Handle<Exception>()
.WaitAndRetry(3, r => TimeSpan.FromSeconds(Math.Pow(2, r)));

public SandwichRequestor(IConfiguration config, IWorkInProgress wip)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Lab03/End/ServicesDemo.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32728.150
VisualStudioVersion = 17.5.33103.201
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gateway", "Gateway\Gateway.csproj", "{C84069C4-CBF5-4386-8DB1-50F148221282}"
EndProject
Expand All @@ -17,7 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RabbitQueue", "RabbitQueue\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SandwichMaker", "SandwichMaker\SandwichMaker.csproj", "{AB364D4F-E098-4416-BFD2-7823D8577302}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{4B0B0105-BCAA-4BB3-92E7-85A953B94EAF}"
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{CCD35124-646B-4CF8-88E0-BEFCE12B516D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -53,10 +53,10 @@ Global
{AB364D4F-E098-4416-BFD2-7823D8577302}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB364D4F-E098-4416-BFD2-7823D8577302}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB364D4F-E098-4416-BFD2-7823D8577302}.Release|Any CPU.Build.0 = Release|Any CPU
{4B0B0105-BCAA-4BB3-92E7-85A953B94EAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B0B0105-BCAA-4BB3-92E7-85A953B94EAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B0B0105-BCAA-4BB3-92E7-85A953B94EAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B0B0105-BCAA-4BB3-92E7-85A953B94EAF}.Release|Any CPU.Build.0 = Release|Any CPU
{CCD35124-646B-4CF8-88E0-BEFCE12B516D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CCD35124-646B-4CF8-88E0-BEFCE12B516D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCD35124-646B-4CF8-88E0-BEFCE12B516D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CCD35124-646B-4CF8-88E0-BEFCE12B516D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion src/Lab03/End/docker-compose.dcproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>4b0b0105-bcaa-4bb3-92e7-85a953b94eaf</ProjectGuid>
<ProjectGuid>ccd35124-646b-4cf8-88e0-befce12b516d</ProjectGuid>
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}</DockerServiceUrl>
<DockerServiceName>gateway</DockerServiceName>
Expand Down
24 changes: 12 additions & 12 deletions src/Lab03/End/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ services:
dockerfile: SandwichMaker/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=

gateway:
image: ${DOCKER_REGISTRY-}gateway
Expand All @@ -23,8 +23,8 @@ services:
dockerfile: Gateway/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=

meatservice:
image: ${DOCKER_REGISTRY}meatservice
Expand All @@ -33,8 +33,8 @@ services:
dockerfile: MeatService/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=

breadservice:
image: ${DOCKER_REGISTRY}breadservice
Expand All @@ -43,8 +43,8 @@ services:
dockerfile: BreadService/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=

cheeseservice:
image: ${DOCKER_REGISTRY}cheeseservice
Expand All @@ -53,8 +53,8 @@ services:
dockerfile: CheeseService/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=

lettuceservice:
image: ${DOCKER_REGISTRY}lettuceservice
Expand All @@ -63,6 +63,6 @@ services:
dockerfile: LettuceService/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=

8 changes: 4 additions & 4 deletions src/Lab03/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ One of the more important of the [12 Factors](https://12factor.net) is that conf
dockerfile: Gateway/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=
```

> ℹ the gateway container will connect to the rabbitmq container using its DNS name `sandwichqueue`.
Expand Down Expand Up @@ -945,8 +945,8 @@ Make sure this file contains an entry for the new `breadservice`:
dockerfile: BreadService/Dockerfile
environment:
- RABBITMQ__URL=sandwichqueue
- RABBITMQ__USER
- RABBITMQ__PASSWORD
- RABBITMQ__USER=
- RABBITMQ__PASSWORD=
```

At this point your `docker-compose.yml` file contains entries only for the `gateway` and `breadservice` services. In reality it needs entries for all the services necessary to run the system in your local environment.
Expand Down

0 comments on commit 402e493

Please sign in to comment.