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 General Pitfalls with Docker into README #528

Closed

Conversation

kerkmann
Copy link
Contributor

@kerkmann kerkmann commented Mar 17, 2023

This is related to the issue #527 :)

Comment on lines +285 to +288
### SwaggerUI not working inside Docker

When running your Rust application with SwaggerUI inside a Docker container, it's only possible to use a release build. This is because the [debug-embed](https://github.com/pyrossh/rust-embed#features) flag is not enabled in debug builds by default, which can cause issues with embedding necessary files into the binary. Therefore, make sure to use the `--release` flag when building your Rust application for use inside Docker.

Copy link
Owner

Choose a reason for hiding this comment

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

Actually it should not be completely necesary to build it with --release flag, but alternatively you can add a cargo debug-embed feature flag to the utoipa-swagger-ui dependency seen here: https://github.com/juhaku/utoipa/tree/master/utoipa-swagger-ui#crate-features. That will enable the RustEmbed's debug-embed feature which allows debug builds to embed files as well.

Copy link
Owner

Choose a reason for hiding this comment

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

I think there could also be a link to the utoipa-swagger-ui's REAMDE.md as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm ... maybe you are right. ^^"

I would at least describe it more, especially with the wording Docker. Because I think some other people will fall into the same kind of problem. ^^"

@juhaku juhaku mentioned this pull request Mar 21, 2023
@juhaku
Copy link
Owner

juhaku commented Mar 21, 2023

Closing due #534

@juhaku juhaku closed this Mar 21, 2023
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.

2 participants