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

Documentation and examples update for use with docker compose v2 #2201

Merged
merged 21 commits into from
Oct 7, 2024

Conversation

tzerber
Copy link
Contributor

@tzerber tzerber commented Apr 18, 2024

Howdy,

I noticed #2194 and the PR but there are more problems with the examples than just the version parameter. Docker changed the file name requirements too, changed the command and some of the syntax, jwilder's proxy is now part of nginx-proxy and more. This PR addresses those changes, and few others as well.

What was changed:

  1. Docs: ( README.MD ) have commands, file names and examples updated everywhere. Minor edits to match the examples section and links.

  2. Files: All docker-compose.yml files are renamed to compose.yaml files as per docker requirements.

  3. Nginx configuration: I've been following the nginx mailing list since the problems we had with mjs file extension last year, and they wont fix it despite browsers expecting it as text/javascript. I have modified the examples to include mime-types from Nginx to the web container, and removed the "workaround" from the nginx.conf file to keep it as consistent as possible with the official Nextcloud docs. Effectively there is no difference from end user point of view.

  4. MariaDB: - Over the years we have several instances running using MariaDB and experience shows that 10.8.2 works better than 10.6 with recent versions of Nextcloud. I fully understand that it's not LTS release but we had several random problems with 10.6 that caused larger downtimes and then we switched to 10.8.2 in production, no issues whatsoever since then. It is also intentional that I didn't go newer than 10.8.2 because I cannot "promote" something to people that I hadn't tested properly myself. Considering majority of users copy-paste the examples and expect them to be working without issues - I believe this is better.

  5. Redis : I've added it on all the places it was missing. It should be there, all it does is speeding up nextcloud in general.

  6. Logging: Added a limit of 50 megabytes of log files on all containers. Recently I noticed that some instances had their log files grown to some absurd sizes (uptime for more than year without updates/downtime) and I've added that to the examples as well, for the same reason i changed the mariadb version. On few places(proxy containers, to be precise) I have intentionally added the logging driver to be syslog, because it works better with fail2ban on the host machine, it can't do any harm and it can hint to semi-sleeping sysadmins that the machine is under bots attack trying to log-in.

EDIT:

  1. php-fpm nginx config: Added the missing headers in the fpm's nginx.conf and fixed the cache control according to the official NC docs. I thought it was a typo, turns out it was quite cheeky way of adding it properly. Now it matches the official docs.

closes #2200

Copy link
Contributor

@J0WI J0WI left a comment

Choose a reason for hiding this comment

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

Why did you add the logging config everywhere?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@J0WI
Copy link
Contributor

J0WI commented Apr 24, 2024

I have modified the examples to include mime-types from Nginx to the web container, and removed the "workaround" from the nginx.conf file to keep it as consistent as possible with the official Nextcloud docs.

IMHO it's bad to duplicate all default mime.types just to modify a single line. Just adding

types {
    text/javascript mjs;
}

should be enough.

Over the years we have several instances running using MariaDB and experience shows that 10.8.2 works better than 10.6 with recent versions of Nextcloud.

We use whatever Nextcloud recommends in their documenation. We also don't pin minor releases because then somebody would need to take care of updates.

All docker-compose.yml files are renamed to compose.yaml files as per docker requirements.

Fine for me but I'm not sure how used people are to docker-compose.yml and if we should stick with it for a while or if this would be more confusing for those still using docker-compose.

Redis

Initially it wasn't added everywhere because it's optional and to keep the examples simple. But technically a database server is also optional.

Logging

Logging is out of scope for the examples. We shouldn't make any assumptions about their logging system.

@J0WI J0WI added the examples Compose/Dockerfile/etc label Apr 24, 2024
@tzerber
Copy link
Contributor Author

tzerber commented Apr 25, 2024

I have modified the examples to include mime-types from Nginx to the web container, and removed the "workaround" from the nginx.conf file to keep it as consistent as possible with the official Nextcloud docs.

IMHO it's bad to duplicate all default mime.types just to modify a single line. Just adding

types {
    text/javascript mjs;
}

should be enough.

You are quite correct here, this is the most "clean" way of doing it. Instead of adding js and mjs, only mjs is added. Thanks !

Over the years we have several instances running using MariaDB and experience shows that 10.8.2 works better than 10.6 with recent versions of Nextcloud.

We use whatever Nextcloud recommends in their documenation. We also don't pin minor releases because then somebody would need to take care of updates.

I thought so, reverted back to 10.6 as per docs.

All docker-compose.yml files are renamed to compose.yaml files as per docker requirements.

Fine for me but I'm not sure how used people are to docker-compose.yml and if we should stick with it for a while or if this would be more confusing for those still using docker-compose.

Docker put the notice of deprecation of V1 syntax quite a long time ago. As per docker docs and requirements, it must be named compose.yaml or compose.yml and this should have been done long ago. docker-compose.yml is the old V1 syntax and it can create more confusion if people update their docker / docker compose plugin.

More info here and here

Redis

Initially it wasn't added everywhere because it's optional and to keep the examples simple. But technically a database server is also optional.

Logging

Logging is out of scope for the examples. We shouldn't make any assumptions about their logging system.

Removed the logging sections too. While I agree with the fact we should not make assumptions, and people using these should take care of that, I think we might mention this problems with the logs somewhere. On a busy instances with more than few users these logs can get quite large and actually cause problems. Nginx and LE compaion tend to output a lot of stuff, most of the time harmless, but they can pile up if all goes well for longer time periods.

Also fixed the random typos here and there, didn't noticed them the last 3 times I've read the changes.

EDIT: I removed the conf volume. It's also based on some assumptions that shouldn't be assumed. It is usually helpful if someone is injecting additional stuff in the proxy, but in a general-use-case where the proxy is used only for NC, that volume is not needed.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@J0WI
Copy link
Contributor

J0WI commented May 13, 2024

I thought so, reverted back to 10.6 as per docs.

Removed the logging sections too.

Needs to be reverted in the README too

@schnillerman
Copy link

schnillerman commented May 16, 2024

I still have the mjs problem and spent 4 hours yesterday (just to say I'm not just lazily expecting help) to see how modifying nginx.conf might help with the well known error message about the mjs mime type. No success. I only mount the nginx.conf specifically in the container from outside, not the mime.types.

I'm working off of this one with the fpm alpine docker compose:

.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf

Some of the posts I read through suggest it has something to do with DNS / domain entries, but a curl to an mjs file from inside the container yields results, so it doesn't seem it's a URL issue.

@tzerber
Copy link
Contributor Author

tzerber commented May 16, 2024

I still have the mjs problem and spent 4 hours yesterday (just to say I'm not just lazily expecting help) to see how modifying nginx.conf might help with the well known error message about the mjs mime type. No success. I only mount the nginx.conf specifically in the container from outside, not the mime.types.

I'm working off of this one with the fpm alpine docker compose:

.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf

Some of the posts I read through suggest it has something to do with DNS / domain entries, but a curl to an mjs file from inside the container yields results, so it doesn't seem it's a URL issue.
Hi,

Use the nginx.conf from this commit, it works fine without the need of mounting the mime-types file. ->> 05353cf

@tzerber
Copy link
Contributor Author

tzerber commented May 16, 2024

I thought so, reverted back to 10.6 as per docs.

Removed the logging sections too.

Needs to be reverted in the README too

Reverted the README me, my bad. Also removed the GH-specific markdown. Fixed the little ":" too.

@tzerber
Copy link
Contributor Author

tzerber commented Sep 16, 2024

Bump, i guess ?

Copy link
Contributor

@J0WI J0WI left a comment

Choose a reason for hiding this comment

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

Please revert --innodb-read-only-compressed=OFF too

@tzerber
Copy link
Contributor Author

tzerber commented Sep 18, 2024

I added them, but I've also noticed the PR for MariaDB 10.11. Should i just change to 10.11 here as well ? @J0WI

EDIT: I'm confused now. What is the correct mysql command, command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW --innodb-read-only-compressed=OFF or command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF because If it's the latter - I also need to update the readme.

Edit 2 : matched to what it's in the current docs. It's been a while since I gave up on MariaDB and moved all the prod instances to postgresql. Still confused on the --log-bin=binlog part.

Signed-off-by: Kaloyan Nikolov <[email protected]>
@J0WI
Copy link
Contributor

J0WI commented Sep 22, 2024

The command should match what's documented in https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database. --innodb-read-only-compressed=OFF is not set there.

@tzerber
Copy link
Contributor Author

tzerber commented Sep 23, 2024

The command should match what's documented in https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database. --innodb-read-only-compressed=OFF is not set there.

Updated it to match to the docs link you provided. In this repo version (front page) there is this section where it says --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW. Updated it to become --transaction-isolation=READ-COMMITTED --binlog-format=ROW as well. Also found a .md file not updated and fixed it's docker compose command.

Also sorry, didn't noticed i pushed the wrong change last time, totally my fault. Will be a bit more careful from now on.

@J0WI
Copy link
Contributor

J0WI commented Sep 24, 2024

I thought so, reverted back to 10.6 as per docs.

Removed the logging sections too.

Needs to be reverted in the README too

Reverted the README me, my bad. Also removed the GH-specific markdown. Fixed the little ":" too.

They are re-added in the README

@tzerber
Copy link
Contributor Author

tzerber commented Sep 24, 2024

I thought so, reverted back to 10.6 as per docs.

Removed the logging sections too.

Needs to be reverted in the README too

Reverted the README me, my bad. Also removed the GH-specific markdown. Fixed the little ":" too.

They are re-added in the README

Found it #1881

db-1 | 2024-09-24 20:28:12 0 [Note] Starting MariaDB 10.6.19-MariaDB-ubu2004 source revision 8f020508c87461bbeee551c3001acac56d506ae7 server_uid 2KQvNCDvu6PQATgLu/GVimw4hjM= as process 103 db-1 | 2024-09-24 20:28:12 0 [Warning] You need to use --log-bin to make --binlog-format work.

Copy link
Contributor

@J0WI J0WI left a comment

Choose a reason for hiding this comment

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

If you add --log-bin back it should keep the name binlog

@tzerber
Copy link
Contributor Author

tzerber commented Oct 2, 2024

I think this is ready now :)

@J0WI J0WI merged commit 38994cb into nextcloud:master Oct 7, 2024
21 checks passed
@J0WI
Copy link
Contributor

J0WI commented Oct 7, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review examples Compose/Dockerfile/etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs and examples update, again
3 participants