Search code examples
dockerlabel-studio

label studio persistent project with docker


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


Solution

  • 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