x86dev / docker-ttrss

Tiny Tiny RSS feed reader as a Docker image.
54 stars 41 forks source link

fix(Dockerfile): Fix permission issue for startup script #58

Open bugwelle opened 1 year ago

bugwelle commented 1 year ago

The startup script could not be started (in my case) because of permission issues. Looking at the log, I saw:

rssreader                | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
rssreader                | [s6-init] ensuring user provided files have correct perms...exited 0.
rssreader                | [fix-attrs.d] applying ownership & permissions fixes...
rssreader                | [fix-attrs.d] done.
rssreader                | [cont-init.d] executing container initialization scripts...
rssreader                | [cont-init.d] 50-php: executing... 
rssreader                | [cont-init.d] 50-php: exited 0.
rssreader                | [cont-init.d] 98-wait-for-db: executing... 
rssreader                | Checking database responds within 1s on postgres:5432...
rssreader                | [cont-init.d] 98-wait-for-db: exited 0.
rssreader                | [cont-init.d] 99-ttrss: executing... 
rssreader                | /var/run/s6/etc/cont-init.d/99-ttrss: line 2: ./setup-ttrss.sh: Permission denied
rssreader                | [cont-init.d] 99-ttrss: exited 126.
rssreader                | [cont-init.d] done.
rssreader                | [services.d] starting services
rssreader                | ./run: cd: line 4: can't cd to /var/www/ttrss: No such file or directory
rssreader                | nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/nginx.conf:39

By passing --chown, we set the file owner to what s6 expects.

bugwelle commented 1 year ago

FYI @x86dev : Even if I fix this issue, I still get an issue with FPM:

rssreader                | [07-Nov-2023 10:18:15] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address in use (98)
rssreader                | [07-Nov-2023 10:18:15] ERROR: FPM initialization failed

Did you encounter that before?

aashley commented 11 months ago

@bugwelle add -F to the exec php-fpm in the php run file, so it doesn't detach and s6 can manage it.

alpine changed default behaviour with 8 so needs some tweaking, see my fork https://github.com/aashley/docker-ttrss i've made a stack of changes to how the fpm runs and its all good

bugwelle commented 11 months ago

@aashley Awesome! Thanks. :) I'll try it out later.

bugwelle commented 11 months ago

Checked out your fork, looked at the diffs, and then tried it out. Works (and I have a few hundred unread items) 🎉

@x86dev The proposal by @aashley above works. I'll keep this PR open, as this is also part of the fix.