I'm trying to have a container with python and poetry:
@function
async def build_and_publish(
self,
src: dagger.Directory,
registry_username: str,
registry_password: dagger.Secret,
):
"""Build and publish"""
await (
dag.container()
.from_("python:3.11")
.with_mounted_directory("/app", src)
.with_workdir("/app")
.with_exec(["pip", "install", "poetry"])
.with_exec(["poetry", "install"])
.with_default_args(["fastapi", "run", "myapp/main.py", "--port", "80"])
.with_registry_auth(
"ghcr.io/username/myapp:latest",
registry_username,
registry_password,
)
.publish("ghcr.io/username/myapp:latest")
)
The container is succesfully published to Github registry but when I start it with:
docker run -it --pull always ghcr.io/username/myapp bash
The /app folder is empty !
What I missed ?