-
Notifications
You must be signed in to change notification settings - Fork 39
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
Docker prod build #2
Comments
@ghotiphud link to embed_migrations is now broken. Also, an example as to how to use embed_migrations would be super useful if you already have a clue how to ! It's not easy yet to find anything on the web about how to use that properly |
Well, here's the updated link: https://docs.rs/diesel/0.16.0/diesel/macro.embed_migrations.html The basic usage is embed_migrations!("../migrations/sqlite");
fn main() {
let connection = establish_connection();
// This will run the necessary migrations.
embedded_migrations::run(&connection);
// By default the output is thrown out. If you want to redirect it to stdout, you
// should call embedded_migrations::run_with_output.
embedded_migrations::run_with_output(&connection, &mut std::io::stdout());
} which as far as I know, basically does an include_str!() (https://doc.rust-lang.org/std/macro.include_str.html) for all the files in your migrations directory. |
See comments here: https://www.reddit.com/r/rust/comments/6u27xp/my_dockerized_rocket_diesel_and_react_starter/
Multi-stage build + diesel embed_migrations!()
(http://docs.diesel.rs/diesel/macro.embed_migrations.html) is probably the way to go.
Alpine + musl??
The text was updated successfully, but these errors were encountered: