Skip to content

Commit

Permalink
add docker configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
ratanparai committed Jun 5, 2021
1 parent 9e820a8 commit ee0fd7b
Show file tree
Hide file tree
Showing 9 changed files with 209 additions and 7 deletions.
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.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
18 changes: 18 additions & 0 deletions docker-compose.dcproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>1eab640a-1fcc-4cde-957e-1ac0a6e6b7ab</ProjectGuid>
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/swagger</DockerServiceUrl>
<DockerServiceName>graphql.api</DockerServiceName>
</PropertyGroup>
<ItemGroup>
<None Include="docker-compose.override.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
</ItemGroup>
</Project>
29 changes: 29 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.4'

services:
graphql.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "7000:80"

address.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "7001:80"


payment.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "7002:80"


student.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "7003:80"

29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.4'

services:
graphql.api:
image: ${DOCKER_REGISTRY-}graphqlapi
build:
context: .
dockerfile: src/Gateway/Graphql.API/Dockerfile

address.api:
image: ${DOCKER_REGISTRY-}addressapi
build:
context: .
dockerfile: src/Services/Address/Address.API/Dockerfile


payment.api:
image: ${DOCKER_REGISTRY-}paymentapi
build:
context: .
dockerfile: src/Services/Payment/Payment.API/Dockerfile


student.api:
image: ${DOCKER_REGISTRY-}studentapi
build:
context: .
dockerfile: src/Services/Student/Student.API/Dockerfile

31 changes: 24 additions & 7 deletions graphql-bff.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{31ABBD13-5B2
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gateway", "Gateway", "{8C9CE111-2854-4321-A159-91E7DD2E2874}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Graphql.API", "src\Gateway\Graphql.API\Graphql.API.csproj", "{78221D7E-D3B2-4755-B359-C60989036186}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphql.API", "src\Gateway\Graphql.API\Graphql.API.csproj", "{78221D7E-D3B2-4755-B359-C60989036186}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{E97856A9-79F8-4118-A86F-26A15C44E731}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Student", "Student", "{0F6109DC-C231-4DA5-AB99-011B78629BFD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Student.API", "src\Services\Student\Student.API\Student.API.csproj", "{1540F9F4-2EC2-441E-92F4-29774F902B31}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Student.API", "src\Services\Student\Student.API\Student.API.csproj", "{1540F9F4-2EC2-441E-92F4-29774F902B31}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Payment", "Payment", "{C3778DEF-F1E2-4772-AAAC-6EED4EC4280A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payment.API", "src\Services\Payment\Payment.API\Payment.API.csproj", "{F9C405C4-3C3C-4F56-8307-C56BD46640B6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payment.API", "src\Services\Payment\Payment.API\Payment.API.csproj", "{F9C405C4-3C3C-4F56-8307-C56BD46640B6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Address", "Address", "{6B39C3F0-FA20-4B69-8240-07A1FFCEBB1D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Address.API", "src\Services\Address\Address.API\Address.API.csproj", "{A47CE2E7-C532-4FC6-92D4-133F20E4DD61}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Address.API", "src\Services\Address\Address.API\Address.API.csproj", "{A47CE2E7-C532-4FC6-92D4-133F20E4DD61}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -32,9 +34,6 @@ Global
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{78221D7E-D3B2-4755-B359-C60989036186}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78221D7E-D3B2-4755-B359-C60989036186}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand Down Expand Up @@ -84,6 +83,21 @@ Global
{A47CE2E7-C532-4FC6-92D4-133F20E4DD61}.Release|x64.Build.0 = Release|Any CPU
{A47CE2E7-C532-4FC6-92D4-133F20E4DD61}.Release|x86.ActiveCfg = Release|Any CPU
{A47CE2E7-C532-4FC6-92D4-133F20E4DD61}.Release|x86.Build.0 = Release|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Debug|x64.ActiveCfg = Debug|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Debug|x64.Build.0 = Debug|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Debug|x86.ActiveCfg = Debug|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Debug|x86.Build.0 = Debug|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Release|Any CPU.Build.0 = Release|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Release|x64.ActiveCfg = Release|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Release|x64.Build.0 = Release|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Release|x86.ActiveCfg = Release|Any CPU
{1EAB640A-1FCC-4CDE-957E-1AC0A6E6B7AB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8C9CE111-2854-4321-A159-91E7DD2E2874} = {31ABBD13-5B20-4051-90A0-BB10100A004D}
Expand All @@ -96,4 +110,7 @@ Global
{6B39C3F0-FA20-4B69-8240-07A1FFCEBB1D} = {E97856A9-79F8-4118-A86F-26A15C44E731}
{A47CE2E7-C532-4FC6-92D4-133F20E4DD61} = {6B39C3F0-FA20-4B69-8240-07A1FFCEBB1D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {834D42E7-8173-4415-85BE-C8844CFE2A86}
EndGlobalSection
EndGlobal
21 changes: 21 additions & 0 deletions src/Gateway/Graphql.API/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/Gateway/Graphql.API/Graphql.API.csproj", "src/Gateway/Graphql.API/"]
RUN dotnet restore "src/Gateway/Graphql.API/Graphql.API.csproj"
COPY . .
WORKDIR "/src/src/Gateway/Graphql.API"
RUN dotnet build "Graphql.API.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Graphql.API.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Graphql.API.dll"]
21 changes: 21 additions & 0 deletions src/Services/Address/Address.API/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/Services/Address/Address.API/Address.API.csproj", "src/Services/Address/Address.API/"]
RUN dotnet restore "src/Services/Address/Address.API/Address.API.csproj"
COPY . .
WORKDIR "/src/src/Services/Address/Address.API"
RUN dotnet build "Address.API.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Address.API.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Address.API.dll"]
21 changes: 21 additions & 0 deletions src/Services/Payment/Payment.API/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/Services/Payment/Payment.API/Payment.API.csproj", "src/Services/Payment/Payment.API/"]
RUN dotnet restore "src/Services/Payment/Payment.API/Payment.API.csproj"
COPY . .
WORKDIR "/src/src/Services/Payment/Payment.API"
RUN dotnet build "Payment.API.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Payment.API.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Payment.API.dll"]
21 changes: 21 additions & 0 deletions src/Services/Student/Student.API/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/Services/Student/Student.API/Student.API.csproj", "src/Services/Student/Student.API/"]
RUN dotnet restore "src/Services/Student/Student.API/Student.API.csproj"
COPY . .
WORKDIR "/src/src/Services/Student/Student.API"
RUN dotnet build "Student.API.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Student.API.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Student.API.dll"]

0 comments on commit ee0fd7b

Please sign in to comment.