{"id":13418694,"url":"https://github.com/michaeloliverx/python-poetry-docker-example","last_synced_at":"2025-09-08T20:35:25.724Z","repository":{"id":40489611,"uuid":"244711621","full_name":"michaeloliverx/python-poetry-docker-example","owner":"michaeloliverx","description":"Example of integrating Poetry with Docker leveraging multi-stage builds.","archived":false,"fork":false,"pushed_at":"2024-05-05T15:42:05.000Z","size":21,"stargazers_count":371,"open_issues_count":2,"forks_count":60,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-08T20:35:25.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaeloliverx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-03T18:30:06.000Z","updated_at":"2025-06-17T08:39:31.000Z","dependencies_parsed_at":"2024-11-01T05:32:16.263Z","dependency_job_id":null,"html_url":"https://github.com/michaeloliverx/python-poetry-docker-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaeloliverx/python-poetry-docker-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeloliverx%2Fpython-poetry-docker-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeloliverx%2Fpython-poetry-docker-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeloliverx%2Fpython-poetry-docker-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeloliverx%2Fpython-poetry-docker-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeloliverx","download_url":"https://codeload.github.com/michaeloliverx/python-poetry-docker-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeloliverx%2Fpython-poetry-docker-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231507,"owners_count":25245601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:05.666Z","updated_at":"2025-09-08T20:35:25.690Z","avatar_url":"https://github.com/michaeloliverx.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# Poetry managed Python FastAPI application with Docker multi-stage builds\n\n### This repo serves as a minimal reference on setting up docker multi-stage builds with poetry\n\n\n### Requirements\n\n- [Docker \u003e= 17.05](https://www.python.org/downloads/release/python-381/)\n- [Python \u003e= 3.7](https://www.python.org/downloads/release/python-381/)\n- [Poetry](https://github.com/python-poetry/poetry)\n\n\n---\n**NOTE** - Run all commands from the project root\n\n\n## Local development\n\n---\n## Poetry\n\n\nCreate the virtual environment and install dependencies with:\n\n        poetry install\n\nSee the [poetry docs](https://python-poetry.org/docs/) for information on how to add/update dependencies.\n\nRun commands inside the virtual environment with:\n\n        poetry run \u003cyour_command\u003e\n\nSpawn a shell inside the virtual environment with\n\n        poetry shell\n\nStart a development server locally\n\n        poetry run uvicorn app.main:app --reload --host localhost --port 8000\n\nAPI will be available at [localhost:8000/](http://localhost:8000/)\n\nSwagger docs at [localhost:8000/docs](http://localhost:8000/docs)\n\nTo run testing/linting locally you would execute lint/test in the [scripts directory](/scripts).\n\n\n---\n\n## Docker\n\n\nBuild images with:\n        \n        docker build --tag poetry-project --file docker/Dockerfile . \n\nThe Dockerfile uses multi-stage builds to run lint and test stages before building the production stage.  If linting or testing fails the build will fail.\n\nYou can stop the build at specific stages with the `--target` option:\n\n        docker build --name poetry-project --file docker/Dockerfile . --target \u003cstage\u003e\n\n\nFor example we wanted to stop at the **test** stage:\n\n        docker build --tag poetry-project --file docker/Dockerfile --target test .\n\nWe could then get a shell inside the container with:\n\n        docker run -it poetry-project:latest bash\n\nIf you do not specify a target the resulting image will be the last image defined which in our case is the 'production' image.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeloliverx%2Fpython-poetry-docker-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeloliverx%2Fpython-poetry-docker-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeloliverx%2Fpython-poetry-docker-example/lists"}