From 54eab1bf89fb68ddc7930c5482df9e87a543322f Mon Sep 17 00:00:00 2001 From: S Date: Sun, 1 Mar 2026 10:22:02 -0500 Subject: [PATCH] feat: switch docker-compose template from port mapping to macvlan Remove ports: section (no more host port mapping). Add networks: with static ipv4_address for gitea and db containers. Reference external gitea_net network (macvlan created by phase scripts). Add DB_CONTAINER_IP for database service networking. Co-Authored-By: Claude Opus 4.6 --- templates/docker-compose-gitea.yml.tpl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/templates/docker-compose-gitea.yml.tpl b/templates/docker-compose-gitea.yml.tpl index 5613933..6d6b230 100644 --- a/templates/docker-compose-gitea.yml.tpl +++ b/templates/docker-compose-gitea.yml.tpl @@ -1,5 +1,5 @@ # Gitea Docker Compose — rendered by phase1_gitea_unraid.sh and phase2_gitea_fedora.sh -# Variables: GITEA_VERSION, DATA_PATH, GITEA_PORT, GITEA_SSH_PORT +# Variables: GITEA_VERSION, DATA_PATH, GITEA_CONTAINER_IP # DATA_PATH is host-specific (UNRAID_GITEA_DATA_PATH or FEDORA_GITEA_DATA_PATH) # DB_SERVICE block is stripped for sqlite3, kept for mysql/postgres/mssql. @@ -20,6 +20,9 @@ ${DB_ENV_VARS} interval: 10s timeout: 5s retries: 5 + networks: + gitea_net: + ipv4_address: ${DB_CONTAINER_IP} # DB_SERVICE_END gitea: @@ -39,12 +42,16 @@ ${DB_ENV_VARS} - ${DATA_PATH}/config:/data/gitea/conf # app.ini lives here - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro - ports: - - "${GITEA_PORT}:3000" # Web UI + API - - "${GITEA_SSH_PORT}:22" # Git over SSH (host port 22 is taken by SSH server) + networks: + gitea_net: + ipv4_address: ${GITEA_CONTAINER_IP} healthcheck: test: ["CMD", "curl", "-sf", "http://localhost:3000/api/v1/version"] interval: 30s timeout: 5s retries: 3 start_period: 30s + +networks: + gitea_net: + external: true