structurizr / lite

Structurizr Lite
https://docs.structurizr.com/lite
MIT License
226 stars 26 forks source link

workspace.dsl not loading in structurizr/lite Docker container #102

Closed dtlhlbs closed 9 months ago

dtlhlbs commented 9 months ago

Question

I am running Docker on WIndows 10.

  1. Create a data directory
  2. Launch docker using docker run -it --rm -p 8080:8080 -v $pwd\data:/usr/local/structurizr structurizr/onpremises
  3. Log into http://localhost:8080/
  4. Create a workspace
  5. I see that there is now a 1 folder in my data directory containing workspace.json

The Usage docs says

Structurizr Lite will look for a workspace.dsl and workspace.json file in your Structurizr data directory, in that order, and use the file it finds first.

I'd assume this means I can put a workspace.dsl next to workspace.json and it's take precedence. But if I add the example workspace.dsl and restart the container it doesn't change anything.

If I remove the workspace.json and just leave the workspace.dsl I get errors:

[WARN ] 2023-11-20 21:09:09.316 [pool-3-thread-1] SearchController - Error indexing workspace with ID 1
com.structurizr.onpremises.component.workspace.WorkspaceComponentException: Could not get workspace 1

The Lite Quickstart docs also say:

At startup, Structurizr Lite created a file named workspace.dsl in your Structurizr data directory as a starting point.

I can't find workspace.dsl in the root of the data directory. If I put the example there it has no effect.

Lastly, the Lite Workflow docs say:

Create your workspace using the DSL, as a file named workspace.dsl in your Structurizr Lite data directory. As mentioned, adding workspace.dsl in the root of the data directory is having no effect.

I'd like to use the DSL file as that seems cleaner and there's more documentation. But I can't see how to load it using the structurizr/lite Docker image.