<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_server_shutdown(self):
 """Stop the container before shutting down."""

        if not self._container:
            return
        self._container.stop()
        self._container.remove(v=True, force=True)