From 38eb20d144b5201a38640afb95e09fb5524e850a Mon Sep 17 00:00:00 2001 From: mi16087 Date: Sun, 19 Apr 2026 22:31:53 +0200 Subject: [PATCH 1/3] Add dockerfile for ApplicationService --- src/Services/ApplicationService/.dockerignore | 30 +++++++++++++++++ src/Services/ApplicationService/Dockerfile | 29 +++++++++++++++++ .../Properties/launchSettings.json | 32 ++++++++++++------- 3 files changed, 79 insertions(+), 12 deletions(-) create mode 100644 src/Services/ApplicationService/.dockerignore create mode 100644 src/Services/ApplicationService/Dockerfile diff --git a/src/Services/ApplicationService/.dockerignore b/src/Services/ApplicationService/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/src/Services/ApplicationService/.dockerignore @@ -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/** \ No newline at end of file diff --git a/src/Services/ApplicationService/Dockerfile b/src/Services/ApplicationService/Dockerfile new file mode 100644 index 0000000..4d1f77b --- /dev/null +++ b/src/Services/ApplicationService/Dockerfile @@ -0,0 +1,29 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 + + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["ApplicationService.csproj", "."] +RUN dotnet restore "./ApplicationService.csproj" +COPY . . +WORKDIR "/src/." +RUN dotnet build "./ApplicationService.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./ApplicationService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "ApplicationService.dll"] \ No newline at end of file diff --git a/src/Services/ApplicationService/Properties/launchSettings.json b/src/Services/ApplicationService/Properties/launchSettings.json index 8498ff5..a4fe396 100644 --- a/src/Services/ApplicationService/Properties/launchSettings.json +++ b/src/Services/ApplicationService/Properties/launchSettings.json @@ -1,23 +1,31 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", +{ "profiles": { "http": { "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "http://localhost:5020", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5020" }, "https": { "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "https://localhost:7290;http://localhost:5020", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7290;http://localhost:5020" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true } - } -} + }, + "$schema": "https://json.schemastore.org/launchsettings.json" +} \ No newline at end of file From 46d32749d03714776301c8900b982809edfaf9fb Mon Sep 17 00:00:00 2001 From: mi16087 Date: Sun, 19 Apr 2026 22:34:08 +0200 Subject: [PATCH 2/3] Add newlines at the end of all files --- src/Services/ApplicationService/.dockerignore | 2 +- src/Services/ApplicationService/Dockerfile | 2 +- src/Services/ApplicationService/Properties/launchSettings.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Services/ApplicationService/.dockerignore b/src/Services/ApplicationService/.dockerignore index fe1152b..8a0a6f1 100644 --- a/src/Services/ApplicationService/.dockerignore +++ b/src/Services/ApplicationService/.dockerignore @@ -27,4 +27,4 @@ README.md !.git/HEAD !.git/config !.git/packed-refs -!.git/refs/heads/** \ No newline at end of file +!.git/refs/heads/** diff --git a/src/Services/ApplicationService/Dockerfile b/src/Services/ApplicationService/Dockerfile index 4d1f77b..60ce4e2 100644 --- a/src/Services/ApplicationService/Dockerfile +++ b/src/Services/ApplicationService/Dockerfile @@ -26,4 +26,4 @@ RUN dotnet publish "./ApplicationService.csproj" -c $BUILD_CONFIGURATION -o /app FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "ApplicationService.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "ApplicationService.dll"] diff --git a/src/Services/ApplicationService/Properties/launchSettings.json b/src/Services/ApplicationService/Properties/launchSettings.json index a4fe396..880eb0a 100644 --- a/src/Services/ApplicationService/Properties/launchSettings.json +++ b/src/Services/ApplicationService/Properties/launchSettings.json @@ -28,4 +28,4 @@ } }, "$schema": "https://json.schemastore.org/launchsettings.json" -} \ No newline at end of file +} From c3f9a2c072e4144204db62e020f99559e3c34f1c Mon Sep 17 00:00:00 2001 From: mi16087 Date: Sun, 19 Apr 2026 23:40:44 +0200 Subject: [PATCH 3/3] Remove HTTPS from Application service --- .../Properties/launchSettings.json | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Services/ApplicationService/Properties/launchSettings.json b/src/Services/ApplicationService/Properties/launchSettings.json index 880eb0a..fa79611 100644 --- a/src/Services/ApplicationService/Properties/launchSettings.json +++ b/src/Services/ApplicationService/Properties/launchSettings.json @@ -8,23 +8,14 @@ "dotnetRunMessages": true, "applicationUrl": "http://localhost:5020" }, - "https": { - "commandName": "Project", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "https://localhost:7290;http://localhost:5020" - }, "Container (Dockerfile)": { "commandName": "Docker", - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "launchUrl": "http://{ServiceHost}:{ServicePort}", "environmentVariables": { - "ASPNETCORE_HTTPS_PORTS": "8081", "ASPNETCORE_HTTP_PORTS": "8080" }, "publishAllPorts": true, - "useSSL": true + "useSSL": false } }, "$schema": "https://json.schemastore.org/launchsettings.json"