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

Multi-platform Dockerfile #2235

Merged
merged 8 commits into from Nov 27, 2023
Merged

Multi-platform Dockerfile #2235

merged 8 commits into from Nov 27, 2023

Conversation

kroese
Copy link
Contributor

@kroese kroese commented Nov 26, 2023

Description

The backend supports ARM now, but that is not very useful as long as the frontend does not.

So this PR lets the frontend Dockerfile be build for ARM64 (and also x86 CPU's missing the SSE4 instruction set).

It is based on the work of ubergeek77, all credits to him.

Fixes: #1566
Fixes: #2106

It also adds the propers labels, adds a healthcheck to monitor the container, and switches Inferno to production-mode which should increase performance.

Dockerfile Outdated
@@ -1,16 +1,41 @@
FROM golang as go-builder
Copy link
Member

Choose a reason for hiding this comment

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

What is golang needed for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To build node-prune from source, because the pre-compiled one does not support ARM.

Dockerfile Outdated Show resolved Hide resolved
@SleeplessOne1917 SleeplessOne1917 mentioned this pull request Nov 27, 2023
@dessalines
Copy link
Member

I'll start a test build to make sure this one's good. Thx for these!

@dessalines
Copy link
Member

Actually I can't because for some reason edits by maintainers aren't being allowed.

@kroese
Copy link
Contributor Author

kroese commented Nov 27, 2023

@dessalines Is that something that I can change in the settings of my fork?

Currently Inferno runs in development mode because NODE_ENV=production was not set. This has a negative effect on performance, and for debugging purposes developers can override this flag in their Docker composefile.
@dessalines
Copy link
Member

Yeah, I think it might just be a checkmark somewhere on the pull request specifically. https://stackoverflow.com/questions/63341296/github-pull-request-allow-edits-by-maintainers#63341866

@kroese kroese marked this pull request as draft November 27, 2023 01:28
@kroese kroese marked this pull request as ready for review November 27, 2023 01:29
@kroese
Copy link
Contributor Author

kroese commented Nov 27, 2023

I did not have this checkbox anywhere. Turned out that was because I forked it into an organization account and not my personal account. I transferred the repo now and enabled the checkbox.

@dessalines
Copy link
Member

No probs. Build started, I'll keep an eye on it to make sure it passes.

@dessalines
Copy link
Member

Question, node-prune the only thing that requires go correct? Because if that's the case I'm in favor of just removing it, since development is dead on it. I'm sure there are better ways to minimize node docker images now.

@dessalines
Copy link
Member

I fixed some issues. Another build started.

@kroese
Copy link
Contributor Author

kroese commented Nov 27, 2023

@dessalines Yes the golang stage was only for node-prune. The current image size is around 160 MB so lets see if that increases much without the pruning.

@kroese
Copy link
Contributor Author

kroese commented Nov 27, 2023

Failed with context deadline exceeded?

@dessalines
Copy link
Member

I increased the timeout from 1h to 2h and restarted it. Not sure why these ones take so long, not even the CI for the lemmy back-end docker builds are this slow.

@kroese
Copy link
Contributor Author

kroese commented Nov 27, 2023

Yeah, I build them via Github Actions and both the frontend and the backend take about 15 minutes each to build. And that is with the standard GitHub-hosted runners, which are very under-powered.

So unless this Woodpecker runner is even slower than the machines that Github offers for free, it seems like something might be misconfigured.

@dessalines
Copy link
Member

@dessalines dessalines merged commit 639aa28 into LemmyNet:main Nov 27, 2023
2 checks passed
@ubergeek77 ubergeek77 mentioned this pull request Jan 10, 2024
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.

ARM builds for Docker lemmy-ui (0.18.0) docker image fails to run on CPUs not supporting SSE4
3 participants