Establish a runtime dependency from a container to a network service. The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set. The service will be reachable from the container via t
(self, alias: str, service: "Service")
| 3554 | return Container(_ctx) |
| 3555 | |
| 3556 | def with_service_binding(self, alias: str, service: "Service") -> Self: |
| 3557 | """Establish a runtime dependency from a container to a network service. |
| 3558 | |
| 3559 | The service will be started automatically when needed and detached |
| 3560 | when it is no longer needed, executing the default command if none is |
| 3561 | set. |
| 3562 | |
| 3563 | The service will be reachable from the container via the provided |
| 3564 | hostname alias. |
| 3565 | |
| 3566 | The service dependency will also convey to any files or directories |
| 3567 | produced by the container. |
| 3568 | |
| 3569 | Parameters |
| 3570 | ---------- |
| 3571 | alias: |
| 3572 | Hostname that will resolve to the target service (only accessible |
| 3573 | from within this container) |
| 3574 | service: |
| 3575 | The target service |
| 3576 | """ |
| 3577 | _args = [ |
| 3578 | Arg("alias", alias), |
| 3579 | Arg("service", service), |
| 3580 | ] |
| 3581 | _ctx = self._select("withServiceBinding", _args) |
| 3582 | return Container(_ctx) |
| 3583 | |
| 3584 | def with_symlink( |
| 3585 | self, |