forked from MDCPS/DamageAssessment_Backend
		
	Dockerize with DocuLinks Inital version
This commit is contained in:
		| @ -5,6 +5,8 @@ | ||||
|     <Nullable>enable</Nullable> | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|     <GenerateDocumentationFile>True</GenerateDocumentationFile> | ||||
|     <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||||
|     <DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath> | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
| @ -22,6 +24,7 @@ | ||||
|       <PrivateAssets>all</PrivateAssets> | ||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|     </PackageReference> | ||||
|     <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" /> | ||||
|     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|  | ||||
							
								
								
									
										30
									
								
								DamageAssesmentApi/DamageAssesment.Api.Documents/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								DamageAssesmentApi/DamageAssesment.Api.Documents/Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @ -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"] | ||||
| @ -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 | ||||
|     } | ||||
|   } | ||||
| } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user