coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
31.79k stars 1.64k forks source link

[Bug]: Docker Compose file removes the mounted SMB shares #2323

Open SpuriousGer opened 3 months ago

SpuriousGer commented 3 months ago

Description

I have the following Docker Compose file where I would expect the SMB shares to be mounted but instead they are not mounted and other shares are created:

version: '3.8'
services:
  broker:
    image: 'docker.io/library/redis:7'
    restart: unless-stopped
    volumes:
      - 'redisdata:/data'
  db:
    image: 'docker.io/library/postgres:15'
    restart: unless-stopped
    volumes:
      - 'pgdata:/var/lib/postgresql/data'
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: paperless
  webserver:
    image: 'ghcr.io/paperless-ngx/paperless-ngx:latest'
    restart: unless-stopped
    depends_on:
      - db
      - broker
    ports:
      - '9001:8000'
    volumes:
      - 'smb_data:/usr/src/paperless/data'
      - 'smb_media:/usr/src/paperless/media'
      - 'smb_export:/usr/src/paperless/export'
      - 'smb_consume:/usr/src/paperless/consume'
    environment:
      PAPERLESS_REDIS: 'redis://broker:6379'
      PAPERLESS_DBHOST: db
      PAPERLESS_CONSUMER_RECURSIVE: 'true'
      PAPERLESS_URL: 'https://paperless.paperless.io'
      PAPERLESS_FILENAME_FORMAT: '{created_year}{created_month}/{correspondent}{title}_{created_year}{created_month}{created_day}'
      PAPERLESS_SECRET_KEY: 'sdfhaskjdfhasjdfhasljk'
      PAPERLESS_CONSUMER_BARCODE_UPSCALE: 1.5
      PAPERLESS_CONSUMER_BARCODE_DPI: 600
      PAPERLESS_CONSUMER_ENABLE_BARCODES: 'true'
      PAPERLESS_CONSUMER_ENABLE_TAG_BARCODE: 'true'
      PAPERLESS_CONSUMER_TAG_BARCODE_MAPPING: '{"[a-fA-F0-9]{64}": "\g<0>"}'
      PAPERLESS_CONSUMER_BARCODE_SCANNER: ZXING
      PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS: true
    user: '0:0'
    cap_add:
      - SYS_ADMIN
      - DAC_READ_SEARCH
    privileged: true
volumes:
  smb_data:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-data
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  smb_media:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-media
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  smb_export:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-export
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  smb_consume:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-consume
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  pgdata: null
  redisdata: null

This is then converted to this deployable Compose and I have no clue why this happens:

services:
  broker:
    image: 'docker.io/library/redis:7'
    restart: unless-stopped
    volumes:
      - 'swgksgw_redisdata:/data'
    networks:
      swgksgw: null
    labels:
      - coolify.managed=true
      - coolify.version=4.0.0-beta.291
      - coolify.serviceId=3
      - coolify.type=service
      - coolify.name=broker-swgksgw
      - coolify.pullRequestId=0
      - coolify.service.subId=7
      - coolify.service.subType=application
    container_name: broker-swgksgw
  db:
    image: 'docker.io/library/postgres:15'
    restart: unless-stopped
    volumes:
      - 'swgksgw_pgdata:/var/lib/postgresql/data'
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: paperless
    networks:
      swgksgw: null
    labels:
      - coolify.managed=true
      - coolify.version=4.0.0-beta.291
      - coolify.serviceId=3
      - coolify.type=service
      - coolify.name=db-swgksgw
      - coolify.pullRequestId=0
      - coolify.service.subId=8
      - coolify.service.subType=application
    container_name: db-swgksgw
  webserver:
    image: 'ghcr.io/paperless-ngx/paperless-ngx:latest'
    restart: unless-stopped
    depends_on:
      - db
      - broker
    ports:
      - '9001:8000'
    volumes:
      - 'swgksgw_smb-data:/usr/src/paperless/data'
      - 'swgksgw_smb-media:/usr/src/paperless/media'
      - 'swgksgw_smb-export:/usr/src/paperless/export'
      - 'swgksgw_smb-consume:/usr/src/paperless/consume'
    environment:
      PAPERLESS_REDIS: 'redis://broker:6379'
      PAPERLESS_DBHOST: db
      PAPERLESS_CONSUMER_RECURSIVE: 'true'
      PAPERLESS_URL: 'https://paperless.paperless.io'
      PAPERLESS_FILENAME_FORMAT: '{created_year}{created_month}/{correspondent}{title}_{created_year}{created_month}{created_day}'
      PAPERLESS_SECRET_KEY: 'sdfhaskjdfhasjdfhasljk'
      PAPERLESS_CONSUMER_BARCODE_UPSCALE: 1.5
      PAPERLESS_CONSUMER_BARCODE_DPI: 600
      PAPERLESS_CONSUMER_ENABLE_BARCODES: 'true'
      PAPERLESS_CONSUMER_ENABLE_TAG_BARCODE: 'true'
      PAPERLESS_CONSUMER_TAG_BARCODE_MAPPING: '{"[a-fA-F0-9]{64}": "\g<0>"}'
      PAPERLESS_CONSUMER_BARCODE_SCANNER: ZXING
      PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS: true
    user: '0:0'
    cap_add:
      - SYS_ADMIN
      - DAC_READ_SEARCH
    privileged: true
    networks:
      swgksgw: null
    labels:
      - coolify.managed=true
      - coolify.version=4.0.0-beta.291
      - coolify.serviceId=3
      - coolify.type=service
      - coolify.name=webserver-swgksgw
      - coolify.pullRequestId=0
      - coolify.service.subId=9
      - coolify.service.subType=application
    container_name: webserver-swgksgw
volumes:
  smb_data:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-data
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  smb_media:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-media
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  smb_export:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-export
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  smb_consume:
    driver: local
    driver_opts:
      type: cifs
      device: //10.10.10.11/paperless-consume
      o: 'username=smbtest,password=smbtest,vers=3.0,uid=0,gid=0,dir_mode=0777,file_mode=0777'
  pgdata: null
  redisdata: null
  swgksgw_redisdata:
    name: swgksgw_redisdata
  swgksgw_pgdata:
    name: swgksgw_pgdata
  swgksgw_smb-data:
    name: swgksgw_smb-data
  swgksgw_smb-media:
    name: swgksgw_smb-media
  swgksgw_smb-export:
    name: swgksgw_smb-export
  swgksgw_smb-consume:
    name: swgksgw_smb-consume
networks:
  swgksgw:
    name: swgksgw
    external: true

I can mount it if I run it locally not through Coolify. This seems to be weird.

Also, why can I not change the storages here:

image

Minimal Reproduction (if possible, example repository)

Use the Docker Compose file I have above and paste it in a new resource based on Docker Compose.

Exception or Error

No errors occur, but the share it not mounted.

Version

v4.0.0-beta.291

andrasbacsai commented 3 months ago

It will be fixed in the upcoming version.

SpuriousGer commented 3 months ago

Excellent, thank you very much!

siavashs commented 3 weeks ago

I'm hitting a similar issue but with nfs mounts. It seems the issue is not fixed. Tested on v4.0.0-beta.323 The volumes are ignored and instead new empty volumes are created under Deployable Compose.