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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile rebuild #1881

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

Rukongai
Copy link
Contributor

@Rukongai Rukongai commented Feb 17, 2024

Checklist

馃毃 Please review the guidelines for contributing to this repository. 馃毃

  • Make sure you are making a pull request against our main branch (left side)
  • Check that that your branch is up to date with our main.
  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your main!
  • Check that the tests and code linter both pass.
  • If you're a new contributor, please sign our contributor license agreement.

Warnings

  • This PR will change existing database contents.
  • This PR introduces a breaking change to existing installations.

Summary

This allows the docker to run the application as an arbitrary non-root user (currently set to 1000:1000)

Linked issues

resolves聽#1704

Description of changes

I mangled and salvaged a majority of this from the redmine project.

I've tested it and pared down extraneous code, but I'm sure that there are still parts that are unnecessary. This shouldn't break anything, but let me know if you notice anything.

@Rukongai
Copy link
Contributor Author

Rukongai commented Feb 17, 2024

This is missing a line to set the pool count for the database. I added it locally, but i'm still getting an error in my logs

[641a49bb-4166-4494-98aa-9c6cc062183a] ActiveRecord::ConnectionTimeoutError (could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use):
[641a49bb-4166-4494-98aa-9c6cc062183a]   
[641a49bb-4166-4494-98aa-9c6cc062183a] app/controllers/application_controller.rb:12:in `auto_login_single_user'

I'm finally setting up debugging so I can track down if this is related to a config issue on my part. The impact seems to be that previews intermittently don't load.


Edit: I fixed this. The entrypoint file was not setting the pool configuration item in database.yml

@Floppy
Copy link
Collaborator

Floppy commented Feb 17, 2024

This is fantastic work, thank you! The use of PUID and PGID is great; I want to get this packaged up as a linuxserver.io release and that's the way they do their user config, so this should be compatible with that I guess?

I'll roll an experimental docker release in the next day or two and deploy it up to https://try.manyfold.app to test it in a proper environment, then get it merged.

@Rukongai
Copy link
Contributor Author

Thanks!

As for the PUID/PGID options in the docker-compose file they might be redundant? I really like linuxserver images, but i'm not sure how they are doing those assignments. I'll have to poke around.

I think they might be redundant here, because i'm statically the manyfold user to 1000:1000 in the dockerfile, so setting it the docker-compose feels like it probably isn't doing anything.

At least the files are no longer generated as root, so that's nice.

Copy link

codeclimate bot commented Feb 18, 2024

Code Climate has analyzed commit 12b4975 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 73.6% (0.0% change).

View more on Code Climate.

@Floppy
Copy link
Collaborator

Floppy commented Feb 18, 2024

As for the PUID/PGID options in the docker-compose file they might be redundant?

Oh, yes, I see they're not actually used! I think they could probably replace the hardcoded numbers in the adduser line.

@Floppy
Copy link
Collaborator

Floppy commented Jun 12, 2024

I've finally had time to take a look at this, and now there are some conflicts because the PR does a few things that have already been merged in - sorry!

I'm probably going to have to pull it apart a bit in order to merge in what's still needed, bear with me :)

@Floppy
Copy link
Collaborator

Floppy commented Jun 12, 2024

I took a different approach to this, using s6-overlay as many other containers do. I think most of the stuff in this is now covered by other PRs:

I think the main missing thing you've got in here is the multi-database support by adding them into database.yml, which is a really nice idea - I'll see if I can add that in somewhere.

I'll convert this to draft if you don't mind, because I don't think it will ever merge as-is, and it will help me remember :)

@Floppy Floppy marked this pull request as draft June 12, 2024 15:48
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.

None yet

2 participants