cross-posted from: https://programming.dev/post/50318205

This is my compose file for syncthing

services:
  syncthing:
    image: syncthing/syncthing:latest
    container_name: syncthing
    hostname: syncthing-nas
    environment:
      - PUID=1026
      - PGID=100
      - TZ=Etc/UTC
    volumes:
      - ./config:/var/syncthing/config 
      - /path/to/data:/var/syncthing
    network_mode: host
    restart: unless-stopped
    healthcheck:
      test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never
        OK || exit 1
      interval: 1m
      timeout: 10s
      retries: 3
networks: {}

Running it give me this error

syncthing  | ERR Failed to ensure directory exists (error="mkdir /var/syncthing/config: permission denied" log.pkg=main)
syncthing exited with code 1
syncthing  | ERR Failed to ensure directory exists (error="mkdir /var/syncthing/config: permission denied" log.pkg=main)
syncthing exited with code 1

This is permission issue with ./config:/var/syncthing/config

I have indeed messed up with folder and file permission for path/to/syncthing/config

I tried to fix it with

chown 1026:100 -R /volume1/docker3/syncthing
chmod 777 -R /volume1/docker3/syncthing

But it didn’t work

I have also tried to change permission using synology GUI but still fail to run the docker compose

I would greatly appreciate any help.