The discussion revolves around the issue of a shared folder not being mounted in a Docker container when running Discourse. hongquan initially reported the problem, stating that the /shared folder is accessible on their localhost but not on their production server.
sam suggested that the issue might be related to different locations on the host and container, pointing to the configuration file on GitHub. However, hongquan failed to understand the solution and provided their container configuration for further assistance.
After analyzing the configuration, hongquan discovered that the /shared folder is indeed mounted but not in the root directory /. Instead, it is located in the current working directory with a long path.
Additionally, hongquan encountered another issue where some Discourse files had their names changed, resulting in broken images on their forum.
In an update, hongquan found that they can access the /shared folder using ./launcher ssh app to enter the container.
Hi. I setup Discourse with Docker 1.6.2 (build 7c8fca2). It tried on my localhost first, then did in production server. On my localhost, from container I can see /shared folder, while in production server, I cannot find.
$ ./launcher enter app
root@prodhk-app:/var/lib/docker/aufs/mnt/c97af5f16febf4ae5e0f01a47750381373f3003f0fad79eddab6b89074a7a389# ls /
bin home lib64 nonexistent run sys vmlinuz
boot initrd.img lost+found opt sbin tmp vmlinuz.old
dev initrd.img.old media proc selinux usr
etc lib mnt root srv var
How can I solve this? I need the shared folder to backup the database.
The config means that the folder /var/discourse/shared/standalone in host will be mounted as /shared in container. But as you can see in my demonstration, after enter the container, I list directory at / but don’t see shared.
I can see the shared folder in immediate current folder after entering the container, which has very long path, but not in “/”
$ ./launcher enter app
root@prodhk-app:/var/lib/docker/aufs/mnt/7c7f4a00525254ad0eb2ab5f745113a54ada0c9b05fa07761299bed4891ea19c# pwd
/var/lib/docker/aufs/mnt/7c7f4a00525254ad0eb2ab5f745113a54ada0c9b05fa07761299bed4891ea19c
root@prodhk-app:/var/lib/docker/aufs/mnt/7c7f4a00525254ad0eb2ab5f745113a54ada0c9b05fa07761299bed4891ea19c# ls
bin dev home lib64 mnt proc root sbin src sys usr
boot etc lib media opt pups run shared srv tmp var
root@prodhk-app:/var/lib/docker/aufs/mnt/7c7f4a00525254ad0eb2ab5f745113a54ada0c9b05fa07761299bed4891ea19c# ls /
bin etc initrd.img.old lost+found nonexistent root selinux tmp vmlinuz
boot home lib media opt run srv usr vmlinuz.old
dev initrd.img lib64 mnt proc sbin sys var
But this “shared” folder doesn’t contains any subfolder, such as postgres_backup, uploads…
Another issue, may be related to this, is that some files of Discourse are changed the name:
root@prodhk-app:/var/lib/docker/aufs/mnt/7c7f4a00525254ad0eb2ab5f745113a54ada0c9b05fa07761299bed4891ea19c# cd var/www/discourse/public/images/welcome/
root@prodhk-app:/var/lib/docker/aufs/mnt/7c7f4a00525254ad0eb2ab5f745113a54ada0c9b05fa07761299bed4891ea19c/var/www/discourse/public/images/welcome# ls
emoji-completion-2x.png quote-reply-cs.png topic-notification-control-2x.png
like-link-flag-bookmark-2x.png reply-as-linked-topic-2x.png topics-new-unread-2x.png
notification-panel-2x.png reply-post-2x.png username-completion-2x.png
progress-bar-2x.png reply-topic-2x.png username-completion-cs.png
quote-reply-2x.png topic-list-select-areas-2x.png
The reply-post.png is changed to reply-post-2x.png. This makes images in our forum broken.
---- Update 2
I can access /shared folder if I use ./launcher ssh app to enter the container.