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

Fix #2741 - Prevent excessive disk writes by only adding frontend service when in development #3044

Merged
merged 1 commit into from
Jul 19, 2023
Merged

Fix #2741 - Prevent excessive disk writes by only adding frontend service when in development #3044

merged 1 commit into from
Jul 19, 2023

Conversation

6twenty
Copy link
Contributor

@6twenty 6twenty commented Jul 7, 2023

This implements the fix suggested in #2741 (comment)

Unfortunately I'm not sure how to properly build the docker image in order to test this myself, so this is for now untested. The build error I get is:

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 1c25faae-8c5e-4c01-a343-e27860ce8d72::qeafbfkg7uwrk4wmzaom0sdh5: "/frontend/dist": not found

And attempting npm install in the frontend dir yields npm ERR! ERESOLVE unable to resolve dependency tree.

If anyone is able to assist I'd really appreciate it 🙏 in the meantime I've also reached out to the author of s6 (who wrote the comment I linked to) to see if they can confirm that this is the right strategy.

EDIT: just seen that the PR branch gets built automatically, so I'm testing with that 👍

@6twenty
Copy link
Contributor Author

6twenty commented Jul 7, 2023

I've managed to successfully run the built docker image as my local npm instance, and confirmed that with the removal of frontend from the s6 user bundle, the disk writes have stopped.

However, I haven't been able to successfully get the S6_STAGE2_HOOK executable to run when the DEVELOPMENT env var is set to "true"; on exec'ing into the container, the frontend file has not been created in the user bundle directory. Yet, running the /s6-stage2-hook executable directly from inside the container does create that file. So I'm not sure where the problem lies.

@jc21
Copy link
Member

jc21 commented Jul 19, 2023

Actually, this problem was solved in the past, but then s6-overlay was upgraded and with that, the paths of things changed.

In the docker/Dockfile on line 50 there's the following:

RUN rm -rf /etc/services.d/frontend /etc/nginx/conf.d/dev.conf \

which can be replaced with

RUN rm -rf /etc/s6-overlay/s6-rc.d/user/contents.d/frontend /etc/nginx/conf.d/dev.conf \

and that will solve everything and won't affect the development build.

edit: fixed the path

@6twenty
Copy link
Contributor Author

6twenty commented Jul 19, 2023

Thanks @jc21! So much simpler 😅 I've updated the PR accordingly

@nginxproxymanagerci
Copy link

Docker Image for build 10 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-3044

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@6twenty
Copy link
Contributor Author

6twenty commented Jul 19, 2023

Tested the build on my own instance - can confirm that the frontend service is not present and that the disk writes have stopped. Haven't tested in dev mode, though.

@jc21 jc21 merged commit f91f0ee into NginxProxyManager:develop Jul 19, 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