From acb21e544e66e26c8948451ff05abad53002b203 Mon Sep 17 00:00:00 2001 From: Jay Ravani Date: Fri, 18 Sep 2026 20:50:42 +0200 Subject: [PATCH 1/3] chore(environment): name the runtime image for what it carries Dockerfile.server built only the server; it now builds the CLI too, so the name no longer describes it. Renamed to Dockerfile.runtime. The published image name is unchanged, so nothing downstream moves. The server service mounted data/ as a whole, which hid the data/tabula baked into the image behind the host's copy. Anything tested there was testing the host's CSVs, so the no-host-mount configuration the image is built for was never exercised by this file. The dataset directories are now mounted individually. Verified: with the old mount the CSVs come from the host; with the new one they come from the image while the host's lod2 tiles still arrive; with no mounts at all the image carries all 20. The service comment described `go run` against the dev image, no separate build target, and data/ being excluded from the image. None of those had been true since the runtime image was added. --- .github/workflows/docker-publish.yml | 2 +- .../{Dockerfile.server => Dockerfile.runtime} | 0 environment/http/docker-compose.yml | 21 ++++++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) rename environment/{Dockerfile.server => Dockerfile.runtime} (100%) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index fb8f77f..5543b60 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -45,7 +45,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: environment/Dockerfile.server + file: environment/Dockerfile.runtime push: true build-args: | VERSION=${{ steps.meta.outputs.version }} diff --git a/environment/Dockerfile.server b/environment/Dockerfile.runtime similarity index 100% rename from environment/Dockerfile.server rename to environment/Dockerfile.runtime diff --git a/environment/http/docker-compose.yml b/environment/http/docker-compose.yml index 6543740..995689c 100644 --- a/environment/http/docker-compose.yml +++ b/environment/http/docker-compose.yml @@ -40,21 +40,19 @@ services: retries: 5 # The on-request HTTP wrapper (cmd/server), for TentaCron's proxy targets to - # reach. `go run` against the already-COPY'd source in the same dev image — - # no separate build target, matches the interactive `city2tabula` service. - # data/ is .dockerignore'd (mounted at runtime everywhere else in this repo - # too), so the TABULA CSV import needs the same volume mount as above. + # reach. The same image also carries the CLI, so it can be run one-shot as a + # pipeline job without a second artefact. city2tabula-server: container_name: city2tabula-server - # Dockerfile.server, not Dockerfile: the server runs a compiled binary on a - # JRE base, where the interactive service needs the full toolchain image. + # Dockerfile.runtime, not Dockerfile: this runs compiled binaries on a JRE + # base, where the interactive service needs the full toolchain image. # With both image and build set, `compose up` builds locally and tags the # result, while `compose pull` fetches the published tag instead. A # deployment pins C2T_IMAGE_TAG to a release rather than tracking latest. image: ghcr.io/thd-spatial-ai/city2tabula-server:${C2T_IMAGE_TAG:-latest} build: context: ./../.. - dockerfile: environment/Dockerfile.server + dockerfile: environment/Dockerfile.runtime environment: DB_HOST: city2tabula-db DB_PORT: 5432 @@ -65,10 +63,13 @@ services: SERVER_PORT: 5000 # PYLOVO_FDW_HOST intentionally unset: no PyLovo dataset behind this # instance, leaves PyLovo linking a clean no-op (internal/process/pylovo_fdw.go). - # The image already carries data/tabula; this mount adds the 3D datasets - # under data/lod2 and data/lod3, which are gitignored and stay on the host. + # The dataset directories specifically, not data/ as a whole: the image + # bakes data/tabula, and mounting the parent would hide it behind the host's + # copy. A deployment then needs no TABULA files on the host at all, which is + # the configuration the image is built for and this file has to exercise. volumes: - - ./../../data:/app/data + - ./../../data/lod2:/app/data/lod2 + - ./../../data/lod3:/app/data/lod3 depends_on: city2tabula-db: condition: service_healthy From 8d16ef7e78bd948694bcf77ddda122f1fb82ea00 Mon Sep 17 00:00:00 2001 From: Jay Ravani Date: Mon, 21 Sep 2026 22:33:23 +0200 Subject: [PATCH 2/3] chore(environment): drop the dev shell's host port The city2tabula-environment service runs bash for interactive CLI use and serves nothing on port 5000, so publishing it only occupied host port 5000. Remove the mapping and the HOST_PORT variable that fed it. --- environment/http/docker-compose.yml | 2 -- environment/http/docker.env | 3 --- 2 files changed, 5 deletions(-) diff --git a/environment/http/docker-compose.yml b/environment/http/docker-compose.yml index 995689c..6c599c5 100644 --- a/environment/http/docker-compose.yml +++ b/environment/http/docker-compose.yml @@ -17,8 +17,6 @@ services: - ./../../data:/app/data # mount full project for development extra_hosts: - "host.docker.internal:host-gateway" # Linux compatibility - ports: - - "${HOST_PORT:-5000}:5000" # map host port (configurable) to container port 8080 command: bash # start an interactive shell for development city2tabula-db: diff --git a/environment/http/docker.env b/environment/http/docker.env index f90cf7f..f4b3b96 100644 --- a/environment/http/docker.env +++ b/environment/http/docker.env @@ -28,9 +28,6 @@ COUNTRY=germany # Note: These countries are available based on the TABULA and EPISCOPE project data. Therefore running pipeline on other countries is not supported. -# Application port mapping (host port -> container 8080) -# Change this if 8080 collides with another service -HOST_PORT=5000 # Database connection settings (Connect to host PostgreSQL) DB_NAME=city2tabula_test From 4c42fddb4ca97f1104d7cdbbe5874e9ebb1fb5f4 Mon Sep 17 00:00:00 2001 From: Jay Ravani Date: Mon, 21 Sep 2026 22:40:18 +0200 Subject: [PATCH 3/3] chore(environment): name containers after their service The HTTP service's container becomes city2tabula, matching the other heat-stack services such as buem-gateway, and the interactive CLI shell becomes city2tabula-cli instead of city2tabula-environment. The makefile and setup scripts exec into the new CLI name. city2tabula-server stays as a network alias on tentacron-net so existing TentaCron proxy targets keep resolving until they move to the new name. The published image name is unchanged. --- environment/http/docker-compose.yml | 20 ++++++++++++-------- makefile | 8 ++++---- setup.bat | 10 +++++----- setup.ps1 | 10 +++++----- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/environment/http/docker-compose.yml b/environment/http/docker-compose.yml index 6c599c5..ef58fad 100644 --- a/environment/http/docker-compose.yml +++ b/environment/http/docker-compose.yml @@ -4,8 +4,8 @@ name: city2tabula services: - city2tabula: - container_name: city2tabula-environment + city2tabula-cli: + container_name: city2tabula-cli build: context: ./../.. dockerfile: environment/Dockerfile @@ -26,7 +26,7 @@ services: POSTGRES_USER: ${C2T_DB_USER:-postgres} POSTGRES_PASSWORD: ${C2T_DB_PASSWORD:-postgres} POSTGRES_DB: ${C2T_DB_NAME:-city2tabula} - # No host port published: city2tabula-server reaches this over the + # No host port published: the city2tabula service reaches this over the # compose default network by service name. Add one back if a host tool # (psql, QGIS) needs direct access. volumes: @@ -40,8 +40,8 @@ services: # The on-request HTTP wrapper (cmd/server), for TentaCron's proxy targets to # reach. The same image also carries the CLI, so it can be run one-shot as a # pipeline job without a second artefact. - city2tabula-server: - container_name: city2tabula-server + city2tabula: + container_name: city2tabula # Dockerfile.runtime, not Dockerfile: this runs compiled binaries on a JRE # base, where the interactive service needs the full toolchain image. # With both image and build set, `compose up` builds locally and tags the @@ -81,13 +81,17 @@ services: # default is listed explicitly because naming any network here drops the # implicit default membership, which is how city2tabula-db is reached. networks: - - default - - tentacron-net + default: {} + tentacron-net: + # Former container name, kept until TentaCron's proxy targets use + # "city2tabula". + aliases: + - city2tabula-server volumes: city2tabula-db-data: -# A cross-repo caller reaches city2tabula-server by attaching to this project's +# A cross-repo caller reaches city2tabula by attaching to this project's # network, rather than this file joining one another repo owns. Depending on # another project's network meant depending on its project name, which is a side # effect of its directory rather than anything it promised to keep: ignis renamed diff --git a/makefile b/makefile index 81b4685..a1793b8 100644 --- a/makefile +++ b/makefile @@ -34,16 +34,16 @@ status: ## Check container status ##@ Application Commands dev: ## Start development environment with shell - cd environment/http && docker compose --env-file docker.env up -d && docker exec -it city2tabula-environment bash + cd environment/http && docker compose --env-file docker.env up -d && docker exec -it city2tabula-cli bash create-db: up ## Create database and setup schemas - cd environment/http && docker exec -it city2tabula-environment ./c2t -create-db + cd environment/http && docker exec -it city2tabula-cli ./c2t -create-db extract-features: up ## Extract building features - cd environment/http && docker exec -it city2tabula-environment ./c2t -extract-features + cd environment/http && docker exec -it city2tabula-cli ./c2t -extract-features reset-db: up ## Reset the entire database - cd environment/http && docker exec -it city2tabula-environment ./c2t -reset-db + cd environment/http && docker exec -it city2tabula-cli ./c2t -reset-db ##@ Complete Workflows configure: ## Interactive configuration: select country and enter password diff --git a/setup.bat b/setup.bat index 9eef546..1d08c3b 100644 --- a/setup.bat +++ b/setup.bat @@ -309,7 +309,7 @@ goto end echo Starting development environment... cd environment\http docker compose --env-file docker.env up -d -docker exec -it city2tabula-environment bash +docker exec -it city2tabula-cli bash cd ..\.. goto end @@ -317,7 +317,7 @@ goto end call :up echo Creating database and setting up schemas... cd environment\http -docker exec -it city2tabula-environment ./c2t -create-db +docker exec -it city2tabula-cli ./c2t -create-db cd ..\.. goto end @@ -325,7 +325,7 @@ goto end call :up echo Extracting building features... cd environment\http -docker exec -it city2tabula-environment ./c2t -extract-features +docker exec -it city2tabula-cli ./c2t -extract-features cd ..\.. goto end @@ -333,7 +333,7 @@ goto end call :up echo Resetting the entire database... cd environment\http -docker exec -it city2tabula-environment ./c2t -reset-db +docker exec -it city2tabula-cli ./c2t -reset-db cd ..\.. goto end @@ -341,7 +341,7 @@ goto end call :up echo Checking City2TABULA version... cd environment\http -docker exec -it city2tabula-environment ./c2t -version +docker exec -it city2tabula-cli ./c2t -version cd ..\.. goto end diff --git a/setup.ps1 b/setup.ps1 index 46de6fa..6c4f5d4 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -198,7 +198,7 @@ function Invoke-Dev { Write-Host "Starting development environment..." -ForegroundColor Blue Set-Location "environment/http" docker compose --env-file docker.env up -d - docker exec -it city2tabula-environment bash + docker exec -it city2tabula-cli bash Set-Location "../.." } @@ -206,7 +206,7 @@ function Invoke-CreateDb { Invoke-Up Write-Host "Creating database and setting up schemas..." -ForegroundColor Blue Set-Location "environment/http" - docker exec -it city2tabula-environment ./c2t -create-db + docker exec -it city2tabula-cli ./c2t -create-db Set-Location "../.." } @@ -214,7 +214,7 @@ function Invoke-ExtractFeatures { Invoke-Up Write-Host "Extracting building features..." -ForegroundColor Blue Set-Location "environment/http" - docker exec -it city2tabula-environment ./c2t -extract-features + docker exec -it city2tabula-cli ./c2t -extract-features Set-Location "../.." } @@ -222,7 +222,7 @@ function Invoke-ResetDb { Invoke-Up Write-Host "Resetting the entire database..." -ForegroundColor Blue Set-Location "environment/http" - docker exec -it city2tabula-environment ./c2t -reset-db + docker exec -it city2tabula-cli ./c2t -reset-db Set-Location "../.." } @@ -230,7 +230,7 @@ function Invoke-Version { Invoke-Up Write-Host "Checking City2TABULA version..." -ForegroundColor Blue Set-Location "environment/http" - docker exec -it city2tabula-environment ./c2t -version + docker exec -it city2tabula-cli ./c2t -version Set-Location "../.." }