Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ task generateQuickstartComposeConfig {
composeExecutor.parameters.environment.put("DATAHUB_APP_VERSION", '__VERSION__')
composeExecutor.parameters.environment.put("METADATA_SERVICE_AUTH_ENABLED", 'false')

// Set placeholder port values that should remain configurable at runtime
// Use unique high port numbers as placeholders that will be replaced later
composeExecutor.parameters.environment.put("DATAHUB_MAPPED_GMS_PORT", '58080')
composeExecutor.parameters.environment.put("DATAHUB_MAPPED_FRONTEND_PORT", '59002')

def configOutput = composeExecutor.execute('config')

// The `config` returns a fully resolved compose file. We need to replace the DATAHUB_VERSION and HOME with values not available at build time
Expand All @@ -408,6 +413,10 @@ task generateQuickstartComposeConfig {
yaml = new Yaml(dumpOptions)
configOutput = yaml.dump(config)

// Replace port placeholders with environment variable syntax (after YAML processing)
configOutput = configOutput.replace("published: '58080'", 'published: ${DATAHUB_MAPPED_GMS_PORT:-8080}')
configOutput = configOutput.replace("published: '59002'", 'published: ${DATAHUB_MAPPED_FRONTEND_PORT:-9002}')

configOutput = "# This file is generated as part of build process. If any build changes cause this file to be modified, please check in the generated file\n" + configOutput

def outputFile = project.file("${project.projectDir}/quickstart/docker-compose.quickstart-profile.yml")
Expand Down Expand Up @@ -755,4 +764,4 @@ quickstart_configs.each { taskName, config ->
}

// :docker:build builds all docker images.
build.dependsOn buildImagesallImages
build.dependsOn buildImagesallImages
4 changes: 2 additions & 2 deletions docker/quickstart/docker-compose.quickstart-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ services:
ports:
- mode: ingress
target: 8080
published: '8080'
published: ${DATAHUB_MAPPED_GMS_PORT:-8080}
protocol: tcp
volumes:
- type: bind
Expand Down Expand Up @@ -147,7 +147,7 @@ services:
ports:
- mode: ingress
target: 9002
published: '9002'
published: ${DATAHUB_MAPPED_FRONTEND_PORT:-9002}
protocol: tcp
volumes:
- type: bind
Expand Down
Loading