BenjaminPrice / fvtt-docker

Foundry VTT - Docker
MIT License
32 stars 39 forks source link

Node mkdir access error #21

Closed nathonius closed 2 years ago

nathonius commented 3 years ago

I see permission denied errors attempting to run. My user is in the docker group, permissions shouldn't be an issue, but I'm not sure where to go from here. On Ubuntu 20.04, latest docker, docker-compose, etc.

Output:

Error: EACCES: permission denied, mkdir '/data/foundryvtt/Logs'
    at Object.mkdirSync (node:fs:1325:3)
    at File._createLogDirIfNotExist (/opt/foundryvtt/resources/app/node_modules/winston/lib/winston/transports/file.js:691:10)
    at new File (/opt/foundryvtt/resources/app/node_modules/winston/lib/winston/transports/file.js:92:28)
    at createLogger (file:///opt/foundryvtt/resources/app/dist/logging.mjs:1:336)
    at Module.initialize (file:///opt/foundryvtt/resources/app/dist/init.mjs:1:1186)
    at file:///opt/foundryvtt/resources/app/main.mjs:26:15 {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/data/foundryvtt/Logs'
}

docker-compose.yaml

version: '3'
services:
  foundryvtt:
    image: direckthit/fvtt-docker:latest
    container_name: fvtt
    ports:
      - 30000:30000
    volumes:
      - /home/ubuntu/resources:/data/foundryvtt
      - /home/ubuntu/foundryvtt:/host
    restart: unless-stopped
Fexilus commented 3 years ago

A workaround that worked for me is setting root as the user for your service in docker-compose.yaml, so that the entire file is:

version: '3'
services:
  foundryvtt:
    image: direckthit/fvtt-docker:latest
    container_name: fvtt
    user: root
    ports:
      - 30000:30000
    volumes:
      - /home/ubuntu/resources:/data/foundryvtt
      - /home/ubuntu/foundryvtt:/host
    restart: unless-stopped