diff --git a/DamageAssesmentApi/.dockerignore b/DamageAssesmentApi/.dockerignore new file mode 100644 index 0000000..3729ff0 --- /dev/null +++ b/DamageAssesmentApi/.dockerignore @@ -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 \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj b/DamageAssesmentApi/DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj index f33241f..4b1c8e9 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj @@ -1,10 +1,12 @@ - + net6.0 enable enable True + Linux + ..\docker-compose.dcproj @@ -12,6 +14,7 @@ + diff --git a/DamageAssesmentApi/DamageAssesment.Api.Answers/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.Answers/Dockerfile new file mode 100644 index 0000000..2ae373c --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.Answers/Dockerfile @@ -0,0 +1,21 @@ +#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. + +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 ["DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj", "DamageAssesment.Api.Answers/"] +RUN dotnet restore "DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.Answers" +RUN dotnet build "DamageAssesment.Api.Answers.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.Answers.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DamageAssesment.Api.Answers.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Answers/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.Answers/Properties/launchSettings.json index 822163a..991c121 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Answers/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Answers/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:18005", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.Answers": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5200", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5200" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:18005", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Attachments/DamageAssesment.Api.Attachments.csproj b/DamageAssesmentApi/DamageAssesment.Api.Attachments/DamageAssesment.Api.Attachments.csproj index 46a5b7a..9aec665 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Attachments/DamageAssesment.Api.Attachments.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.Attachments/DamageAssesment.Api.Attachments.csproj @@ -5,6 +5,8 @@ enable enable True + Linux + ..\docker-compose.dcproj @@ -14,6 +16,7 @@ + diff --git a/DamageAssesmentApi/DamageAssesment.Api.Attachments/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.Attachments/Dockerfile new file mode 100644 index 0000000..82e7391 --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.Attachments/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. + +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 ["DamageAssesment.Api.Attachments/DamageAssesment.Api.Attachments.csproj", "DamageAssesment.Api.Attachments/"] +RUN dotnet restore "DamageAssesment.Api.Attachments/DamageAssesment.Api.Attachments.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.Attachments" +RUN dotnet build "DamageAssesment.Api.Attachments.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.Attachments.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +# Create directories for attachments and set permissions +RUN mkdir -p /app/DMS_Attachments/Active && \ + mkdir -p /app/DMS_Attachments/Deleted && \ + chown -R www-data:www-data /app/DMS_Attachments + +# Update appsettings.json with the correct paths for attachments +RUN sed -i 's#"folderpath": "DMS_Attachments/Active"#"folderpath": "/app/DMS_Attachments/Active"#' appsettings.json && \ + sed -i 's#"Deletepath": "DMS_Attachments/Deleted"#"Deletepath": "/app/DMS_Attachments/Deleted"#' appsettings.json +ENTRYPOINT ["dotnet", "DamageAssesment.Api.Attachments.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Attachments/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.Attachments/Properties/launchSettings.json index 8d37224..5aa2562 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Attachments/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Attachments/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:65305", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.Attachments": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5243", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5243" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:65305", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Documents/DamageAssesment.Api.DocuLinks.csproj b/DamageAssesmentApi/DamageAssesment.Api.Documents/DamageAssesment.Api.DocuLinks.csproj index dab0e6c..a72f082 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Documents/DamageAssesment.Api.DocuLinks.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.Documents/DamageAssesment.Api.DocuLinks.csproj @@ -5,6 +5,8 @@ enable enable True + Linux + ..\docker-compose.dcproj @@ -22,6 +24,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/DamageAssesmentApi/DamageAssesment.Api.Documents/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.Documents/Dockerfile new file mode 100644 index 0000000..74ec8b7 --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.Documents/Dockerfile @@ -0,0 +1,30 @@ +#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. + +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 ["DamageAssesment.Api.Documents/DamageAssesment.Api.DocuLinks.csproj", "DamageAssesment.Api.Documents/"] +RUN dotnet restore "DamageAssesment.Api.Documents/DamageAssesment.Api.DocuLinks.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.Documents" +RUN dotnet build "DamageAssesment.Api.DocuLinks.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.DocuLinks.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +# Create directories for attachments and set permissions +RUN mkdir -p /app/DASA_Documents/Active && \ + mkdir -p /app/DASA_Documents/Deleted && \ + chown -R www-data:www-data /app/DASA_Documents + +# Update appsettings.json with the correct paths for attachments +RUN sed -i 's#"folderpath": "DASA_Documents/Active"#"folderpath": "/app/DASA_Documents/Active"#' appsettings.json && \ + sed -i 's#"Deletepath": "DASA_Documents/Deleted"#"Deletepath": "/app/DASA_Documents/Deleted"#' appsettings.json + +ENTRYPOINT ["dotnet", "DamageAssesment.Api.DocuLinks.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Documents/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.Documents/Properties/launchSettings.json index e4e08ae..a3cf25e 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Documents/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Documents/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:60754", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.Questions": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5133", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5133" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60754", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Employees/DamageAssesment.Api.Employees.csproj b/DamageAssesmentApi/DamageAssesment.Api.Employees/DamageAssesment.Api.Employees.csproj index a696247..6789613 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Employees/DamageAssesment.Api.Employees.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.Employees/DamageAssesment.Api.Employees.csproj @@ -5,6 +5,8 @@ enable enable True + Linux + ..\docker-compose.dcproj @@ -12,6 +14,7 @@ + diff --git a/DamageAssesmentApi/DamageAssesment.Api.Employees/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.Employees/Dockerfile new file mode 100644 index 0000000..cbc7d04 --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.Employees/Dockerfile @@ -0,0 +1,21 @@ +#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. + +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 ["DamageAssesment.Api.Employees/DamageAssesment.Api.Employees.csproj", "DamageAssesment.Api.Employees/"] +RUN dotnet restore "DamageAssesment.Api.Employees/DamageAssesment.Api.Employees.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.Employees" +RUN dotnet build "DamageAssesment.Api.Employees.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.Employees.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DamageAssesment.Api.Employees.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Employees/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.Employees/Properties/launchSettings.json index 2c81744..b5c560b 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Employees/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Employees/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:14425", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.Employees": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5135", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5135" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:14425", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Locations/DamageAssesment.Api.Locations.csproj b/DamageAssesmentApi/DamageAssesment.Api.Locations/DamageAssesment.Api.Locations.csproj index a696247..6789613 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Locations/DamageAssesment.Api.Locations.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.Locations/DamageAssesment.Api.Locations.csproj @@ -5,6 +5,8 @@ enable enable True + Linux + ..\docker-compose.dcproj @@ -12,6 +14,7 @@ + diff --git a/DamageAssesmentApi/DamageAssesment.Api.Locations/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.Locations/Dockerfile new file mode 100644 index 0000000..bb9aeb9 --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.Locations/Dockerfile @@ -0,0 +1,21 @@ +#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. + +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 ["DamageAssesment.Api.Locations/DamageAssesment.Api.Locations.csproj", "DamageAssesment.Api.Locations/"] +RUN dotnet restore "DamageAssesment.Api.Locations/DamageAssesment.Api.Locations.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.Locations" +RUN dotnet build "DamageAssesment.Api.Locations.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.Locations.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DamageAssesment.Api.Locations.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Locations/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.Locations/Properties/launchSettings.json index 940c35e..36c1779 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Locations/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Locations/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:20458", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.Locations": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5213", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5213" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:20458", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Questions/DamageAssesment.Api.Questions.csproj b/DamageAssesmentApi/DamageAssesment.Api.Questions/DamageAssesment.Api.Questions.csproj index a696247..6789613 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Questions/DamageAssesment.Api.Questions.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.Questions/DamageAssesment.Api.Questions.csproj @@ -5,6 +5,8 @@ enable enable True + Linux + ..\docker-compose.dcproj @@ -12,6 +14,7 @@ + diff --git a/DamageAssesmentApi/DamageAssesment.Api.Questions/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.Questions/Dockerfile new file mode 100644 index 0000000..11f44c9 --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.Questions/Dockerfile @@ -0,0 +1,21 @@ +#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. + +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 ["DamageAssesment.Api.Questions/DamageAssesment.Api.Questions.csproj", "DamageAssesment.Api.Questions/"] +RUN dotnet restore "DamageAssesment.Api.Questions/DamageAssesment.Api.Questions.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.Questions" +RUN dotnet build "DamageAssesment.Api.Questions.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.Questions.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DamageAssesment.Api.Questions.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Questions/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.Questions/Properties/launchSettings.json index e4e08ae..a3cf25e 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Questions/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Questions/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:60754", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.Questions": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5133", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5133" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60754", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.SurveyResponses.csproj b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.SurveyResponses.csproj index 02ef277..1ee7c58 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.SurveyResponses.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.SurveyResponses.csproj @@ -5,6 +5,8 @@ enable enable True + Linux + ..\docker-compose.dcproj @@ -13,6 +15,7 @@ + diff --git a/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/Dockerfile new file mode 100644 index 0000000..0001073 --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/Dockerfile @@ -0,0 +1,21 @@ +#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. + +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 ["DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.SurveyResponses.csproj", "DamageAssesment.Api.SurveyResponses/"] +RUN dotnet restore "DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.SurveyResponses.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.SurveyResponses" +RUN dotnet build "DamageAssesment.Api.SurveyResponses.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.SurveyResponses.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DamageAssesment.Api.SurveyResponses.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/Properties/launchSettings.json index 0d51b15..7bd92b0 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:58856", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.SurveyResponses": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5104", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5104" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:58856", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/appsettings.json b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/appsettings.json index d7b64fc..6aa210e 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/appsettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.SurveyResponses/appsettings.json @@ -6,28 +6,28 @@ } }, "AllowedHosts": "*", - "EndPointSettings": { - "AnswerUrlBase": "http://localhost:5200", - "LocationUrlBase": "http://localhost:5213", - "RegionUrlBase": "http://localhost:5211", - "QuestionUrlBase": "http://localhost:5133", - "EmployeeUrlBase": "http://localhost:5135", - "AttachmentUrlBase": "http://localhost:5243", - "SurveyUrlBase": "http://localhost:5009" - }, - "RessourceSettings": { - "Employee": "/Employees", - "EmployeeById": "/Employees/{0}", - "Question": "/Questions", - "QuestionById": "/Questions/{0}", - "SurveyQuestion": "/Questions/BySurvey/{0}", - "Survey": "/Surveys", - "SurveyById": "/Surveys/{0}", - "Attachment": "/Attachments", - "Answer": "/Answers", - "AnswerByResponse": "/Answers/ByResponse/{0}", - "Location": "/Locations", - "Region": "/Regions" + + "EndPointSettings": { + "AnswerUrlBase": "http://damageassesment.api.answers:80", + "LocationUrlBase": "http://damageassesment.api.locations:80", + "QuestionUrlBase": "http://damageassesment.api.questions:80", + "EmployeeUrlBase": "http://damageassesment.api.employees:80", + "AttachmentUrlBase": "http://damageassesment.api.attachments:80", + "SurveyUrlBase": "http://damageassesment.api.survey:80" + }, + "RessourceSettings": { + "Employee": "/Employees", + "EmployeeById": "/Employees/{0}", + "Question": "/Questions", + "QuestionById": "/Questions/{0}", + "SurveyQuestion": "/Questions/BySurvey/{0}", + "Survey": "/Surveys", + "SurveyById": "/Surveys/{0}", + "Attachment": "/Attachments", + "Answer": "/Answers", + "AnswerByResponse": "/Answers/ByResponse/{0}", + "Location": "/Locations", + "Region": "/Regions" + } } -} diff --git a/DamageAssesmentApi/DamageAssesment.Api.Surveys/DamageAssesment.Api.Surveys.csproj b/DamageAssesmentApi/DamageAssesment.Api.Surveys/DamageAssesment.Api.Surveys.csproj index a696247..6789613 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Surveys/DamageAssesment.Api.Surveys.csproj +++ b/DamageAssesmentApi/DamageAssesment.Api.Surveys/DamageAssesment.Api.Surveys.csproj @@ -5,6 +5,8 @@ enable enable True + Linux + ..\docker-compose.dcproj @@ -12,6 +14,7 @@ + diff --git a/DamageAssesmentApi/DamageAssesment.Api.Surveys/Dockerfile b/DamageAssesmentApi/DamageAssesment.Api.Surveys/Dockerfile new file mode 100644 index 0000000..f11b36b --- /dev/null +++ b/DamageAssesmentApi/DamageAssesment.Api.Surveys/Dockerfile @@ -0,0 +1,21 @@ +#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. + +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 ["DamageAssesment.Api.Surveys/DamageAssesment.Api.Surveys.csproj", "DamageAssesment.Api.Surveys/"] +RUN dotnet restore "DamageAssesment.Api.Surveys/DamageAssesment.Api.Surveys.csproj" +COPY . . +WORKDIR "/src/DamageAssesment.Api.Surveys" +RUN dotnet build "DamageAssesment.Api.Surveys.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DamageAssesment.Api.Surveys.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DamageAssesment.Api.Surveys.dll"] \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.Api.Surveys/Properties/launchSettings.json b/DamageAssesmentApi/DamageAssesment.Api.Surveys/Properties/launchSettings.json index 247b548..0e90cd4 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Surveys/Properties/launchSettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Surveys/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:51498", - "sslPort": 0 - } - }, +{ "profiles": { "DamageAssesment.Api.Surveys": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5009", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5009" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51498", + "sslPort": 0 } } -} +} \ No newline at end of file diff --git a/DamageAssesmentApi/DamageAssesment.sln b/DamageAssesmentApi/DamageAssesment.sln index 0cb2d7c..17eb191 100644 --- a/DamageAssesmentApi/DamageAssesment.sln +++ b/DamageAssesmentApi/DamageAssesment.sln @@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.DocuLin EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.DocuLinks.Test", "DamageAssesment.Api.Documents.Test\DamageAssesment.Api.DocuLinks.Test.csproj", "{884BA4AC-9170-49B1-BD6B-850B350C95C0}" EndProject +Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{0DD44934-6826-43C8-A438-320A05209967}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -111,6 +113,10 @@ Global {884BA4AC-9170-49B1-BD6B-850B350C95C0}.Debug|Any CPU.Build.0 = Debug|Any CPU {884BA4AC-9170-49B1-BD6B-850B350C95C0}.Release|Any CPU.ActiveCfg = Release|Any CPU {884BA4AC-9170-49B1-BD6B-850B350C95C0}.Release|Any CPU.Build.0 = Release|Any CPU + {0DD44934-6826-43C8-A438-320A05209967}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0DD44934-6826-43C8-A438-320A05209967}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DD44934-6826-43C8-A438-320A05209967}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0DD44934-6826-43C8-A438-320A05209967}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DamageAssesmentApi/docker-compose.dcproj b/DamageAssesmentApi/docker-compose.dcproj new file mode 100644 index 0000000..98c753f --- /dev/null +++ b/DamageAssesmentApi/docker-compose.dcproj @@ -0,0 +1,18 @@ + + + + 2.1 + Linux + 0dd44934-6826-43c8-a438-320a05209967 + LaunchBrowser + {Scheme}://localhost:{ServicePort}/swagger + damageassesment.api.answers + + + + docker-compose.yml + + + + + \ No newline at end of file diff --git a/DamageAssesmentApi/docker-compose.override.yml b/DamageAssesmentApi/docker-compose.override.yml new file mode 100644 index 0000000..6e8ea42 --- /dev/null +++ b/DamageAssesmentApi/docker-compose.override.yml @@ -0,0 +1,64 @@ +version: '3.4' + +services: + damageassesment.api.answers: + environment: + - ASPNETCORE_ENVIRONMENT=Development + ports: + - "6001:80" + + damageassesment.api.attachments: + environment: + - ASPNETCORE_ENVIRONMENT=Development + ports: + - "6002:80" + + + damageassesment.api.employees: + environment: + - ASPNETCORE_ENVIRONMENT=Development + ports: + - "6003:80" + + + damageassesment.api.locations: + environment: + - ASPNETCORE_ENVIRONMENT=Development + ports: + - "6004:80" + + + damageassesment.api.questions: + environment: + - ASPNETCORE_ENVIRONMENT=Development + ports: + - "6005:80" + + + damageassesment.api.surveyresponses: + environment: + - ASPNETCORE_ENVIRONMENT=Development + - services__Answers=http://damageassesment.api.answers:80 + - services__Locations=http://damageassesment.api.locations:80 + - services__Questions=http://damageassesment.api.questions:80 + - services__Employees=http://damageassesment.api.employees:80 + - services__Attachments=http://damageassesment.api.attachments:80 + - services__Surveys=http://damageassesment.api.survey:80 + + ports: + - "6006:80" + + + damageassesment.api.surveys: + environment: + - ASPNETCORE_ENVIRONMENT=Development + ports: + - "6007:80" + + + damageassesment.api.doculinks: + environment: + - ASPNETCORE_ENVIRONMENT=Development + ports: + - "6009:80" + diff --git a/DamageAssesmentApi/docker-compose.yml b/DamageAssesmentApi/docker-compose.yml new file mode 100644 index 0000000..70b823e --- /dev/null +++ b/DamageAssesmentApi/docker-compose.yml @@ -0,0 +1,57 @@ +version: '3.4' + +services: + damageassesment.api.answers: + image: ${DOCKER_REGISTRY-}damageassesmentapianswers + build: + context: . + dockerfile: DamageAssesment.Api.Answers/Dockerfile + + damageassesment.api.attachments: + image: ${DOCKER_REGISTRY-}damageassesmentapiattachments + build: + context: . + dockerfile: DamageAssesment.Api.Attachments/Dockerfile + + + damageassesment.api.employees: + image: ${DOCKER_REGISTRY-}damageassesmentapiemployees + build: + context: . + dockerfile: DamageAssesment.Api.Employees/Dockerfile + + + damageassesment.api.locations: + image: ${DOCKER_REGISTRY-}damageassesmentapilocations + build: + context: . + dockerfile: DamageAssesment.Api.Locations/Dockerfile + + + damageassesment.api.questions: + image: ${DOCKER_REGISTRY-}damageassesmentapiquestions + build: + context: . + dockerfile: DamageAssesment.Api.Questions/Dockerfile + + + damageassesment.api.surveyresponses: + image: ${DOCKER_REGISTRY-}damageassesmentapisurveyresponses + build: + context: . + dockerfile: DamageAssesment.Api.SurveyResponses/Dockerfile + + + damageassesment.api.surveys: + image: ${DOCKER_REGISTRY-}damageassesmentapisurveys + build: + context: . + dockerfile: DamageAssesment.Api.Surveys/Dockerfile + + + damageassesment.api.doculinks: + image: ${DOCKER_REGISTRY-}damageassesmentapidoculinks + build: + context: . + dockerfile: DamageAssesment.Api.Documents/Dockerfile + diff --git a/DamageAssesmentApi/launchSettings.json b/DamageAssesmentApi/launchSettings.json new file mode 100644 index 0000000..4c96d28 --- /dev/null +++ b/DamageAssesmentApi/launchSettings.json @@ -0,0 +1,18 @@ +{ + "profiles": { + "Docker Compose": { + "commandName": "DockerCompose", + "commandVersion": "1.0", + "serviceActions": { + "damageassesment.api.answers": "StartDebugging", + "damageassesment.api.attachments": "StartDebugging", + "damageassesment.api.employees": "StartDebugging", + "damageassesment.api.locations": "StartDebugging", + "damageassesment.api.questions": "StartDebugging", + "damageassesment.api.surveyresponses": "StartDebugging", + "damageassesment.api.surveys": "StartDebugging", + "damageassesment.api.doculinks": "StartDebugging" + } + } + } +} \ No newline at end of file