Skip to content

unable to add local files as storage source in label studio docker #3987

Description

@hsbaweja-diligent

I am unable to add local files as storage source in label studio. My docker compose file looks like this

label_studio:
    image: heartexlabs/label-studio:latest
    userns_mode: "host"
    hostname: label_studio
    volumes:
      - /etc/label-studio/data:/label-studio/data/:rw
    depends_on:
      - db
    network_mode: host
    environment:
      - DJANGO_DB=default
      - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
      - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/data/
      - LOCAL_FILES_SERVING_ENABLED=true
      - LOCAL_FILES_DOCUMENT_ROOT=/label-studio/data/
      - POSTGRE_NAME=something
      - POSTGRE_USER=something
      - POSTGRE_PASSWORD=
      - POSTGRE_PORT=7564
      - POSTGRE_HOST=localhost
      - JSON_LOG=1
    restart: always

However adding /label-studio/data/ as absolute path in source storage gives the following issue.

RUNTIME ERROR
Validation error
[ErrorDetail(string="Serving local files can be dangerous, so it's disabled by default. You can enable it with LOCAL_FILES_SERVING_ENABLED environment variable, please check docs: https://labelstud.io/guide/storage.html#Local-storage", code='invalid')]
Version: 1.7.2

Metadata

Metadata

Assignees

Labels

importproblembug or something isn't workingstoragesExternal / Cloud storage connections

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions