Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src

# Copy the solution file
COPY src/DesignPatternsLibrary.sln .

# Copy the main project file
COPY src/DesignPatternsLibrary/DesignPatternsLibrary.csproj DesignPatternsLibrary/

# Copy referenced projects' CSPROJ files
COPY ["src/AdditionalPatterns/EventAggregator/StoreManagement/StoreManagement.csproj", "AdditionalPatterns/EventAggregator/StoreManagement/"]
COPY ["src/BuildingBlocks/BuildingBlocks.csproj", "BuildingBlocks/"]
COPY ["src/AdditionalPatterns/FluentInterface/FluentInterfaceLibrary/FluentInterfaceLibrary.csproj", "AdditionalPatterns/FluentInterface/FluentInterfaceLibrary/"]
COPY ["src/AdditionalPatterns/Interpreter/InterpreterLibrary/InterpreterLibrary.csproj", "AdditionalPatterns/Interpreter/InterpreterLibrary/"]
COPY ["src/AdditionalPatterns/LazyLoad/LazyLoadLibrary/LazyLoadLibrary.csproj", "AdditionalPatterns/LazyLoad/LazyLoadLibrary/"]
COPY ["src/AdditionalPatterns/NullObject/NullObjectLibrary/NullObjectLibrary.csproj", "AdditionalPatterns/NullObject/NullObjectLibrary/"]
COPY ["src/AdditionalPatterns/Repository/OrderManagement/OrderManagement.csproj", "AdditionalPatterns/Repository/OrderManagement/"]
COPY ["src/AdditionalPatterns/Rules/RulesLibrary/RulesLibrary.csproj", "AdditionalPatterns/Rules/RulesLibrary/"]
COPY ["src/AdditionalPatterns/ServiceLocator/OrderProcessing/OrderProcessing.csproj", "AdditionalPatterns/ServiceLocator/OrderProcessing/"]
COPY ["src/AdditionalPatterns/Specification/ProductSpecification/ProductSpecification.csproj", "AdditionalPatterns/Specification/ProductSpecification/"]
COPY ["src/AdditionalPatterns/UnitOfWork/UnitOfWorkLibrary/UnitOfWorkLibrary.csproj", "AdditionalPatterns/UnitOfWork/UnitOfWorkLibrary/"]
COPY ["src/BehavioralPatterns/ChainOfResponsibility/ChainOfResponsibilityLibrary/ChainOfResponsibilityLibrary.csproj", "BehavioralPatterns/ChainOfResponsibility/ChainOfResponsibilityLibrary/"]
COPY ["src/BehavioralPatterns/Command/CommandLibrary/CommandLibrary.csproj", "BehavioralPatterns/Command/CommandLibrary/"]
COPY ["src/BehavioralPatterns/Iterator/IteratorLibrary/IteratorLibrary.csproj", "BehavioralPatterns/Iterator/IteratorLibrary/"]
COPY ["src/BehavioralPatterns/Mediator/MediatorLibrary/MediatorLibrary.csproj", "BehavioralPatterns/Mediator/MediatorLibrary/"]
COPY ["src/BehavioralPatterns/Memento/MementoLibrary/MementoLibrary.csproj", "BehavioralPatterns/Memento/MementoLibrary/"]
COPY ["src/BehavioralPatterns/Observer/ObserverLibrary/ObserverLibrary.csproj", "BehavioralPatterns/Observer/ObserverLibrary/"]
COPY ["src/BehavioralPatterns/State/StateLibrary/StateLibrary.csproj", "BehavioralPatterns/State/StateLibrary/"]
COPY ["src/BehavioralPatterns/Strategy/StrategyLibrary/StrategyLibrary.csproj", "BehavioralPatterns/Strategy/StrategyLibrary/"]
COPY ["src/BehavioralPatterns/TemplateMethod/TemplateMethodLibrary/TemplateMethodLibrary.csproj", "BehavioralPatterns/TemplateMethod/TemplateMethodLibrary/"]
COPY ["src/BehavioralPatterns/Visitor/VisitorLibrary/VisitorLibrary.csproj", "BehavioralPatterns/Visitor/VisitorLibrary/"]
COPY ["src/CreationalPatterns/AbstractFactory/MealSimpleFactory/MealSimpleFactory.csproj", "CreationalPatterns/AbstractFactory/MealSimpleFactory/"]
COPY ["src/CreationalPatterns/AbstractFactory/RestaurantAbstractFactory/RestaurantAbstractFactory.csproj", "CreationalPatterns/AbstractFactory/RestaurantAbstractFactory/"]
COPY ["src/CreationalPatterns/Builder/CustomSandwichBuilder/CustomSandwichBuilder.csproj", "CreationalPatterns/Builder/CustomSandwichBuilder/"]
COPY ["src/CreationalPatterns/FactoryMethod/RestaurantManagement/RestaurantManagement.csproj", "CreationalPatterns/FactoryMethod/RestaurantManagement/"]
COPY ["src/CreationalPatterns/Prototype/PrototypeLibrary/PrototypeLibrary.csproj", "CreationalPatterns/Prototype/PrototypeLibrary/"]
COPY ["src/CreationalPatterns/Singleton/Greeter/Greeter.csproj", "CreationalPatterns/Singleton/Greeter/"]
COPY ["src/StructuralPatterns/Adapter/AdapterLibrary/AdapterLibrary.csproj", "StructuralPatterns/Adapter/AdapterLibrary/"]
COPY ["src/StructuralPatterns/Bridge/BridgeLibrary/BridgeLibrary.csproj", "StructuralPatterns/Bridge/BridgeLibrary/"]
COPY ["src/StructuralPatterns/Composite/CompositeLibrary/CompositeLibrary.csproj", "StructuralPatterns/Composite/CompositeLibrary/"]
COPY ["src/StructuralPatterns/Decorator/DecoratorLibrary/DecoratorLibrary.csproj", "StructuralPatterns/Decorator/DecoratorLibrary/"]
COPY ["src/StructuralPatterns/Facade/FacadeLibrary/FacadeLibrary.csproj", "StructuralPatterns/Facade/FacadeLibrary/"]
COPY ["src/StructuralPatterns/Flyweight/FlyweightLibrary/FlyweightLibrary.csproj", "StructuralPatterns/Flyweight/FlyweightLibrary/"]
COPY ["src/StructuralPatterns/Proxy/ProxyLibrary/ProxyLibrary.csproj", "StructuralPatterns/Proxy/ProxyLibrary/"]

# Restore the NuGet packages for the entire solution
RUN dotnet restore

# Copy the source code for the entire solution
COPY src/ .

# Build and publish the main project
RUN dotnet publish DesignPatternsLibrary/DesignPatternsLibrary.csproj -c Release -o /app/publish

# Generate the runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "DesignPatternsLibrary.dll"]
6 changes: 6 additions & 0 deletions src/DesignPatternsLibrary/DesignPatternsLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AdditionalPatterns\EventAggregator\StoreManagement\StoreManagement.csproj" />
<ProjectReference Include="..\AdditionalPatterns\FluentInterface\FluentInterfaceLibrary\FluentInterfaceLibrary.csproj" />
Expand All @@ -28,6 +33,7 @@
<ProjectReference Include="..\BehavioralPatterns\Strategy\StrategyLibrary\StrategyLibrary.csproj" />
<ProjectReference Include="..\BehavioralPatterns\TemplateMethod\TemplateMethodLibrary\TemplateMethodLibrary.csproj" />
<ProjectReference Include="..\BehavioralPatterns\Visitor\VisitorLibrary\VisitorLibrary.csproj" />
<ProjectReference Include="..\BuildingBlocks\BuildingBlocks.csproj" />
<ProjectReference Include="..\CreationalPatterns\AbstractFactory\MealSimpleFactory\MealSimpleFactory.csproj" />
<ProjectReference Include="..\CreationalPatterns\AbstractFactory\RestaurantAbstractFactory\RestaurantAbstractFactory.csproj" />
<ProjectReference Include="..\CreationalPatterns\Builder\CustomSandwichBuilder\CustomSandwichBuilder.csproj" />
Expand Down
10 changes: 10 additions & 0 deletions src/DesignPatternsLibrary/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"profiles": {
"DesignPatternsLibrary": {
"commandName": "Project"
},
"Container (Dockerfile)": {
"commandName": "Docker"
}
}
}