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
Conversation
Dockerfile
Outdated
@@ -1,16 +1,41 @@ | |||
FROM golang as go-builder |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
I'll start a test build to make sure this one's good. Thx for these! |
Actually I can't because for some reason edits by maintainers aren't being allowed. |
@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.
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 |
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. |
No probs. Build started, I'll keep an eye on it to make sure it passes. |
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. |
I fixed some issues. Another build started. |
@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. |
Failed with |
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. |
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. |
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.