Skip to content

Commit

Permalink
Fix Docker-Compose File Extension for CI (#807)
Browse files Browse the repository at this point in the history
- Fix Docker Compose file extension for CI pipeline
- Correctly use .dockerignore file for faster builds
- Fix minor style error
- Set ContinuousIntegrationBuild flag for CI Docker builds
  • Loading branch information
wsugarman authored Jun 2, 2021
1 parent d08a327 commit 8b4df27
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
12 changes: 11 additions & 1 deletion docker/.dockerignore → .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,15 @@
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/docs
**/samples
test
tools
*.md
LICENSE
README.md

# SourceLink
!.git/HEAD
!.git/config
!.git/refs/heads
2 changes: 1 addition & 1 deletion build/ci-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ variables:
buildConfiguration: 'Release'
imageTag: '$(build.BuildNumber)'
azureContainerRegistry: 'dicomoss.azurecr.io'
dicomServerComposeLocation: 'docker/docker-compose.yaml'
dicomServerComposeLocation: 'docker/docker-compose.yml'
dicomCastComposeLocation: 'converter/dicom-cast/build/docker/docker-compose.yaml'
skipNugetSecurityAnalysis: 'true' # NuGet config contains multiple feeds but meets exception criteria
3 changes: 2 additions & 1 deletion build/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ steps:
dockerComposeFile: $(dicomServerComposeLocation)
projectName: linux
additionalImageTags: ${{parameters.tag}}
arguments: '--build-arg CONTINUOUS_INTEGRATION_BUILD=true'

- task: DockerCompose@0
displayName: 'Push Dicom Server Image'
Expand All @@ -35,7 +36,7 @@ steps:
dockerComposeFile: $(dicomCastComposeLocation)
projectName: linux
additionalImageTags: ${{parameters.tag}}

- task: DockerCompose@0
displayName: 'Push Dicom cast Server Image'
inputs:
Expand Down
3 changes: 2 additions & 1 deletion src/Microsoft.Health.Dicom.Web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ USER nonroot
# Copy the DICOM Server project and build it
FROM mcr.microsoft.com/dotnet/sdk:5.0.300-alpine3.12@sha256:cd03cb780dc61a1ef6e450a9e7025aa34c15a2c03e8a62a5dcfe7f490f7d2905 AS build
ARG BUILD_CONFIGURATION=Release
ARG CONTINUOUS_INTEGRATION_BUILD=false
WORKDIR /dicom-server
COPY . .
WORKDIR /dicom-server/src/Microsoft.Health.Dicom.Web
RUN dotnet build "Microsoft.Health.Dicom.Web.csproj" -c $BUILD_CONFIGURATION -warnaserror
RUN dotnet build "Microsoft.Health.Dicom.Web.csproj" -c $BUILD_CONFIGURATION -p:ContinuousIntegrationBuild=$CONTINUOUS_INTEGRATION_BUILD -warnaserror

# Publish the DICOM Server from the build
FROM build as publish
Expand Down
6 changes: 2 additions & 4 deletions src/Microsoft.Health.Dicom.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ public virtual void ConfigureServices(IServiceCollection services)
});
services.AddDevelopmentIdentityProvider<DataActions>(Configuration, "DicomServer");

// The execution of IHostedServices depends on the order they are added to the dependency injection container, so we
// need to ensure that the schema is initialized before the background workers are started.
services.AddDicomServer(Configuration)
.AddBlobStorageDataStore(Configuration)
.AddMetadataStorageDataStore(Configuration)
.AddSqlServer(Configuration)
/*
The execution of IHostedServices depends on the order they are added to the dependency injection container, so we
need to ensure that the schema is initialized before the background workers are started.
*/
.AddBackgroundWorkers();

AddApplicationInsightsTelemetry(services);
Expand Down

0 comments on commit 8b4df27

Please sign in to comment.