BOUNDARY EFFECTS IN THE GRADIENT THEORY OF PHASE TRANSITIONS