From 01827290f6e05bdc562c7c5c89544d2e48b1cc38 Mon Sep 17 00:00:00 2001 From: Tony Bendis Date: Wed, 28 Apr 2021 19:49:47 -0700 Subject: [PATCH] Added docker files for Tes and TriggerService to enable ad-hoc building on the CoA VM. --- CromwellOnAzure.sln | 3 ++- src/Dockerfile-Tes | 20 ++++++++++++++++++++ src/Dockerfile-TriggerService | 22 ++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/Dockerfile-Tes create mode 100644 src/Dockerfile-TriggerService diff --git a/CromwellOnAzure.sln b/CromwellOnAzure.sln index 87a1fef7..35626bfe 100644 --- a/CromwellOnAzure.sln +++ b/CromwellOnAzure.sln @@ -8,7 +8,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig CodeCoverage.runsettings = CodeCoverage.runsettings src\CommonAssemblyInfo.cs = src\CommonAssemblyInfo.cs - Dockerfile = Dockerfile + src\Dockerfile-Tes = src\Dockerfile-Tes + src\Dockerfile-TriggerService = src\Dockerfile-TriggerService EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CromwellApiClient", "src\CromwellApiClient\CromwellApiClient.csproj", "{98D92D1C-7D23-4517-A5FB-D7948544F15F}" diff --git a/src/Dockerfile-Tes b/src/Dockerfile-Tes new file mode 100644 index 00000000..2afd8cd2 --- /dev/null +++ b/src/Dockerfile-Tes @@ -0,0 +1,20 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env +WORKDIR /app + +# Restore packages in separate layer +COPY TesApi.Web/TesApi.Web.csproj TesApi.Web/ +COPY Tes/Tes.csproj Tes/ +RUN dotnet restore TesApi.Web/TesApi.Web.csproj + +# Copy the rest of the files and publish +COPY . ./ +RUN dotnet publish -c Release -o out --no-restore TesApi.Web/TesApi.Web.csproj + +# Build runtime image +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "tesapi.dll"] diff --git a/src/Dockerfile-TriggerService b/src/Dockerfile-TriggerService new file mode 100644 index 00000000..b6b53258 --- /dev/null +++ b/src/Dockerfile-TriggerService @@ -0,0 +1,22 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env +WORKDIR /app + +# Restore packages in separate layer +COPY TriggerService/TriggerService.csproj TriggerService/ +COPY Tes/Tes.csproj Tes/ +COPY Common/Common.csproj Common/ +COPY CromwellApiClient/CromwellApiClient.csproj CromwellApiClient/ +RUN dotnet restore TriggerService/TriggerService.csproj + +# Copy the rest of the files and publish +COPY . ./ +RUN dotnet publish -c Release -o out --no-restore TriggerService/TriggerService.csproj + +# Build runtime image +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "TriggerService.dll"]