Boundary effects in phase transitions