diff --git a/src/Services/ApplicationService/.dockerignore b/src/Services/ApplicationService/.dockerignore new file mode 100644 index 0000000..8a0a6f1 --- /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/** diff --git a/src/Services/ApplicationService/Dockerfile b/src/Services/ApplicationService/Dockerfile new file mode 100644 index 0000000..60ce4e2 --- /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"] diff --git a/src/Services/ApplicationService/Properties/launchSettings.json b/src/Services/ApplicationService/Properties/launchSettings.json index 8498ff5..fa79611 100644 --- a/src/Services/ApplicationService/Properties/launchSettings.json +++ b/src/Services/ApplicationService/Properties/launchSettings.json @@ -1,23 +1,22 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", +{ "profiles": { "http": { "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "http://localhost:5020", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "https": { - "commandName": "Project", + }, "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "https://localhost:7290;http://localhost:5020", + "applicationUrl": "http://localhost:5020" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchUrl": "http://{ServiceHost}:{ServicePort}", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": false } - } + }, + "$schema": "https://json.schemastore.org/launchsettings.json" }