Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multistage Docker example #14

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Add multistage Docker example #14

merged 1 commit into from
Sep 4, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Sep 4, 2024

Closes #11

@zanieb zanieb force-pushed the zb/multistage branch 2 times, most recently from f5077a3 to 9062e98 Compare September 4, 2024 15:52
@zanieb zanieb requested a review from konstin September 4, 2024 15:53
Dockerfile.multistage Outdated Show resolved Hide resolved
Dockerfile.multistage Show resolved Hide resolved
To build the multistage image:

```console
$ docker build . --file Dockerfile.multistage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL buildx is now the default builder

ENV PATH="/app/.venv/bin:$PATH"

# Run the FastAPI application by default
CMD ["fastapi", "dev", "--host", "0.0.0.0", "/app/src/uv_docker_example"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that this uses dev instead of run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, these examples target the dev experience with bind mounts — so yeah. We should probably be clear about what you'd want different in production builds.

@zanieb zanieb enabled auto-merge (squash) September 4, 2024 16:39
@zanieb zanieb merged commit 383dc38 into main Sep 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove uv from final images
2 participants