label studio persistent project with docker

491 Views Asked by At

I am trying to setup a docker compose file in such a way that when I restart an image of label studio, I don't lose the project that I have created previously. Is there some way of doing this, either by having a volume set to a specific place or having some sort of file that label studio can use on start up to help define projects? This is my current docker compose file:

  lab_studio:
    build:
      context: .
      dockerfile: label_studio.Dockerfile
    container_name: label_studio
    image: label_studio
    environment:
      - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
      - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/
    ports:
      - '8080:8080'
    volumes:
      - ./data:./data:rw

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

I had to add the path that appears in the first few lines when the server starts up. In the case of the docker image, for the compose I had to add the following line in volumes:

 - ./labelstudio:/root/.local/share/label-studio:rw