Skip to content

File Permissions

Nicolas Morales edited this page Mar 17, 2022 · 9 revisions

File Permissions on Host Machine

  • If MODE=DEVELOPMENT is set in the docker-compose.yml, then the web-service inside of the Docker container will run as root. Therefore, no changes to the host machine's archive, images, and cache directories are needed. Simply create the archive, images, and cache directories using for example mkdir archive.

  • If MODE=DEVELOPMENT is not set in the docker-compose.yml, then the web-service inside of the Docker container will run as www-data. Therefore, you will need to change the owner of the host machine's archive, images, and cache directories to www-data. For example, the command sudo chown -R www-data:www-data $DIR/archive will recursively change the ownership of the archive, but make sure to change $DIR to be where the archive lives on the machine, as defined as the source in the docker-compose.yml. If www-data does not exist on the host as a user, first install nginx using sudo apt-get install nginx.

  • The MODE=DEVELOPMENT key allows the web-service to restart whenever code is edited, making it useful for development purposes. It is safer to keep MODE=DEVELOPMENT unset for production purposes, but either way performs equally well.

Clone this wiki locally