Permissions error with FileSystem on Docker: "LocalStore: cannot set store permissions 0744"

Description

I install rocket chat on a Docker container, and get this error when using FileSystem (I was on GridFS by default but want to switch to FS due to a large MongoDB database size):

LocalStore: cannot set store permissions 0744 (EPERM: operation not permitted, chmod '/app/files')

The problem is that the folder inside the docker container has UID 1000. I can not change it with chown or chmod because the operation is not permitted. I tried to create the folder before I bind the volume and it has the rocketchat UID when I create but as soon as I bind the volume the UID changes to 1000.

Server Setup Information

  • Version of Rocket.Chat Server: 0.74.3
  • Operating System: Lubuntu 18.04
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Yes
  • Firewalls involved: No