From e2e56252ecac015a878e418fc4ccf606924b3631 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 6 Jun 2026 20:48:43 +0000 Subject: [PATCH] fix(deploy): always copy docker-compose.yml to server The 'Start Docker stack' step used '[ -f ... ] || cp' for docker-compose.yml, which only copied the file on the first deploy. Subsequent deploys kept the stale copy on the server. The stale copy still had the dead 'nextjs' service with 'env_file: ../.env.production', which docker compose validates on every 'up' and bailed because .env.production is written later by the 'Deploy' step. Changed to unconditional 'cp -f' so the server always has the latest compose file. --- .gitea/workflows/deploy.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index d9550b3..75f1e85 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -86,9 +86,12 @@ jobs: export NEXT_PUBLIC_API_URL="http://localhost:$POSTGREST_HOST_PORT" export POSTGREST_HOST_PORT - # Seed config files into APP_DIR if missing (they live in the repo, not in APP_DIR) + # Seed config files into APP_DIR. The docker-compose.yml + # is copied UNCONDITIONALLY so deploys pick up compose + # changes (the previous `[ -f ... ] ||` guard kept stale + # copies on the server and masked a broken `env_file` path). [ -f $APP_DIR/.env.example ] || cp .env.example $APP_DIR/.env.example - [ -f $APP_DIR/docker-compose.yml ] || cp deploy/docker-compose.yml $APP_DIR/docker-compose.yml + cp -f deploy/docker-compose.yml $APP_DIR/docker-compose.yml cd $APP_DIR [ -f .env ] || cp .env.example .env # Append production secrets to .env (overriding .env.example defaults)