From efca2b5941232538e2a731bf69c7e41ea8a74a06 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Mar 2026 09:46:59 +0000 Subject: [PATCH] build.sh: skip --env-file when env file does not exist docker run fails hard if the path passed to --env-file is missing. Make the flag conditional so apps without an env file (or where the file hasn't been created yet) still start successfully. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH --- builder/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/builder/build.sh b/builder/build.sh index 8756e85..77c0717 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -90,10 +90,16 @@ fi # ── 5. Start new container ──────────────────────────────────────────────────── log "Starting container ${CONTAINER_NAME}…" +ENV_FILE_ARG=() +if [ -n "${ENV_FILE:-}" ] && [ -f "$ENV_FILE" ]; then + ENV_FILE_ARG=(--env-file "$ENV_FILE") +else + log "No env file found at '${ENV_FILE:-}'; starting without one." +fi docker run --detach \ --name "$CONTAINER_NAME" \ --network hiy-net \ - --env-file "$ENV_FILE" \ + "${ENV_FILE_ARG[@]}" \ --expose "$PORT" \ --label "hiy.app=${APP_ID}" \ --label "hiy.port=${PORT}" \