From 594a2a97d58d63907a94e59bde46e7c2a2df1042 Mon Sep 17 00:00:00 2001 From: UGA Innovation Factory Date: Thu, 18 Dec 2025 19:06:11 -0500 Subject: [PATCH] Process docker-compose.yml to TMPDIR before copying to read-only output --- default.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index 7e85d9a..a8d5530 100644 --- a/default.nix +++ b/default.nix @@ -58,13 +58,18 @@ let echo "Source directory contents:" ls -la $src/ || true - # Copy all application files using rsync, excluding files we'll modify - ${pkgs.rsync}/bin/rsync -av --exclude='.git' --exclude='docker-compose.yml' --exclude='.env' --exclude='management-dashboard-web-app/.env' $src/ $out/opt/usda-vision/ - - # Process docker-compose.yml with sed and write directly to destination + # Process docker-compose.yml first and create it in a temp location if [ -f $src/docker-compose.yml ]; then ${pkgs.gnused}/bin/sed 's|env_file:.*management-dashboard-web-app/\.env|env_file: /var/lib/usda-vision/.env|g; s|\./management-dashboard-web-app/\.env|/var/lib/usda-vision/.env|g' \ - $src/docker-compose.yml > $out/opt/usda-vision/docker-compose.yml + $src/docker-compose.yml > $TMPDIR/docker-compose.yml + fi + + # Copy all application files using rsync, excluding files we'll provide separately + ${pkgs.rsync}/bin/rsync -av --exclude='.git' --exclude='docker-compose.yml' --exclude='.env' --exclude='management-dashboard-web-app/.env' $src/ $out/opt/usda-vision/ + + # Copy the processed docker-compose.yml + if [ -f $TMPDIR/docker-compose.yml ]; then + cp $TMPDIR/docker-compose.yml $out/opt/usda-vision/docker-compose.yml fi # Verify files were copied