-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Docker compose not working (new install) #144
Comments
|
Hi @tchapi I tried the following:
If im using a bind mount, e.g.
the data/www directory is empty (overwritten) If I run the command with a volume configuration and make nginx wait for the davis copy to complete
It works. I can now run the migrations Curious to hear if you know why the bind mount initially is not working, where the named volume mount is? I always thought a bind mount copies the content (in this case at /var/www/davis) if the directory does not exist or is empty. |
Yes it's expected, bind mounting obscures the container directory
Davis is not copying anything, it's Docker that manages the volume internally, the content being pre-populated by the container. A caveat to that is that if you update the Davis container, it won't update the files (because they are now managed in the volume, not in the container), so you have to remove the container fully before updating |
What is the use of a mount / volume if the files are overwritten by the container? Is there a way to only expose the relevant files (contacts, calendars, config files that a user can adjust prior to starting the container) to the mount?
|
Same issue here, replacing davis_www with a bind mount results in an empty /var/www/davis inside of the container on first start. I'm using the prebuilt ghcr.io image and trying to use an NFS mount for persistent storage. Pre-populating directories that are later used for persistent data with binaries and stuff is not a very good idea IMO. |
Hi The Davis container has only one service in it:
I'm not sure to see which files you are talking about?
There is no "persistent data" in there (it's only the PHP source code, logs, tmp files), so I don't get your point 🤔 |
This is the first time I've seen it done this way, and it's pretty confusing – especially since I've never even seen volumes/mounts being used for any non-persistent data, so I assumed the contacts, calendars and config dirs in the volume are used for data alongside the DB. Either way, dockerfiles for PHP apps usually include a basic web server so this kind of stuff isn't necessary. This both avoids the issue of updates not actually doing anything since all of the code is in a volume, and makes the whole setup significantly simpler (see koel for an example). Is there any specific reason Davis does it differently? |
The general rule is that Docker containers should only run a single process - to decouple concerns. It's not a hard rule, I know, but I don't consider Davis and a web proxy to be coupled enough to warrant being a single concern.
No, the data is only stored in the DB (except for webdav, but you should mount that separately if needed of course)
YMMV, I've seen both, and when I started Davis back in '19, It was mainly the multiple container option that was the norm. Having everything directly in the image might simplify the setup, but it hides the complexity and increases the maintenance burden (I need a proxy + php-fpm + a process manager to run them + a different entrypoint etc etc). Moreover, I don't want to impose a specific proxy to users that might be opinionated (Nginx or Apache? Caddy? Traefik?) — it's up to you to decide which one you prefer and want to have for your use case. In a nutshell: My goal is to maintain and improve Davis as much as I can, but I don't want to (can't) maintain a convoluted Dockerfile on top of that, for lack of time and expertise All that being said:
|
FYI I've merged #145 and the edge image was correctly built so I consider this issue solved for now. I've started to create a roadmap project where I will add feature requests (like having a combined Docker image) to keep track of it |
→ first attempt at a combined Docker image is here: #150 if you want to have a look |
@breakingflower @romner-set would you be so kind as to test https://github.com/tchapi/davis/pkgs/container/davis-standalone (standalone image with a reserve-proxy) and tell me if it fits your needs / if you have feedback? Thanks a lot! |
Hi @tchapi Thanks for the follow-up!
After, I applied the migrations: Any idea? |
Yes, this is the output:
I've tried with a dedicated volume for the db but it yields the same result. |
That's weird. You have a blank page, but what is the status? Is it a 500, a 400? Can you check the supervisor logs? By connecting to the container, then You should be also able to run |
Ok,
When port-forwarding from ip:9000 to localhost:9000 I get the following:
Is there a way to set logging to debug & stdout? |
Trying the standalone docker container as well. White page here too; using the image on GHCR. davis/docker/configurations/Caddyfile Line 5 in eaac75f
should be
|
I really can't reproduce on my side. Can you have a look in |
There's nothing because you're binding the container to With the modification in place, the container is working. |
The 500 page above (message from @breakingflower) is served by PHP through Caddy, so there will be something in the production log. The two issues are separate.
Thanks, it's indeed better, done in 7ee1cae — unfortunately this will still not solve the 500 |
Oh, that message being under mine made me thought you were replying to me. Sorry! |
The package is up to date, so this should work for you now @NyaomiDEV : https://github.com/tchapi/davis/pkgs/container/davis-standalone |
Hi @tchapi , With this image I get the forward, but there is still a 500. There are no prod / error log files. The only ones in the container are:
|
Correction, the dashboard is loading fine at |
Ah, so it's just the root url EDIT: Thinking about it if you don't have any log, could this be some kind of write permissions in the log folder? |
There is no redirect from 9000/ to 9000/dashboard so i get an error on / ? There is no log, the /var/www/davis/var/ directory is owned by root on container spawn. Perhaps a chown -R www-data:www-data /var/www/davis is needed? I'm not sure which user needs to have permissions to write here. |
No redirect, but a status web page on /
Hmm, interesting. Could you try to chown it and see if it's better on your side? |
@tchapi Apologies for not responding earlier, but I just tested the combined image using the provided compose file and it seems to work well, no issues so far. |
Great @romner-set ! Thank you for your feedback. |
Followed the guide
sh: bin/console: not found
. There is no bin console available in the image.Can you please have a look?
The text was updated successfully, but these errors were encountered: