fix(deploy-node): warunkowy --build gdy serwis ma Dockerfile — kod nie wchodził bez rebuildu (c858dbc)

This commit is contained in:
oskar 2026-07-16 15:05:19 +02:00
parent fb77793c83
commit 77defffc47

View file

@ -120,7 +120,18 @@ for service in "${SERVICES[@]}"; do
COMPOSE_CMD="${COMPOSE_CMD} --env-file ${ENV_FILE}"
fi
$COMPOSE_CMD up -d --remove-orphans
# Services with their own Dockerfile need a rebuild on every deploy —
# otherwise `up -d` sees "container running, image tag unchanged" and skips
# rebuilding even when src/ changed, silently leaving the old code running
# (backlog c858dbc). Services with a prebuilt image (no Dockerfile) don't
# need --build.
if [ -f "${REPO_PATH}/services/${service}/Dockerfile" ]; then
echo "Building ${service} (has Dockerfile)"
$COMPOSE_CMD up -d --build --remove-orphans
else
echo "Using prebuilt image for ${service}"
$COMPOSE_CMD up -d --remove-orphans
fi
done
echo "--- Deployment Complete ---"