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 feature to embed Lemmy for production use #73

Merged
merged 3 commits into from
Dec 23, 2022
Merged

Conversation

Nutomic
Copy link
Member

@Nutomic Nutomic commented Dec 22, 2022

This change adds a new feature flag which compiles the Lemmy backend directly into the Lemmybb binary. It can make deployment easier as there is one less thing to build and deploy. It can also make development easier as you dont need to clone and run Lemmy separately.

To try it, execute cargo run --features embed-lemmy. Also works with cargo build --features embed-lemmy.

I also tried to update the installation instructions to take advantage of this. But i dont have any server to test this on, so it would be better if someone else could do it.

@Tealk
Copy link
Collaborator

Tealk commented Dec 22, 2022

I get the error

cargo run --features embed-lemmy
    Updating git repository `https://github.com/LemmyNet/lemmy.git`
    Updating git submodule `https://github.com/LemmyNet/lemmy-translations.git`
    Updating crates.io index
error: none of the selected packages contains these features: embed-lemmy

@Nutomic
Copy link
Member Author

Nutomic commented Dec 22, 2022

Are you on the branch embed-lemmy-prod?

@Tealk
Copy link
Collaborator

Tealk commented Dec 22, 2022

oh i overlooked that, this is what i get output now

[2022-12-22T17:16:21Z INFO  rocket::launch] 🚀 Rocket has launched from http://127.0.0.1:1244
thread 'main' panicked at 'Error connecting to postgres://lemmy:password@localhost:5432/lemmy', /home/tealk/.cargo/git/checkouts/lemmy-2d52b07039afadd8/9f52d4a/crates/db_schema/src/utils.rs:156:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@Nutomic
Copy link
Member Author

Nutomic commented Dec 22, 2022

Yes you need to have postgres installed and configured. I added the instructions to the readme as part of this pr (same instructions as for lemmy development).

@Tealk Tealk merged commit 1e38568 into main Dec 23, 2022
@Tealk Tealk deleted the embed-lemmy-prod branch December 23, 2022 07:34
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