Merge pull request #1 from chadyred/docs/docker-compose

docs(docker): Add docker-compose file in documentation + handle good permission
This commit is contained in:
Felix Lohmeier 2021-02-03 10:08:03 +01:00 committed by GitHub
commit e52d5e41fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 3 deletions

View File

@ -13,14 +13,30 @@
## usage ## usage
> docker run --rm -v "$PWD":/data:z felixlohmeier/mermaid #### Docker command
> docker run --rm -v "$PWD":/data:z -u "$UID:$GID" felixlohmeier/mermaid myflowchart.mdd
#### Docker compose file
```
version: '3.7'
services:
mermaid:
user: "$UID:$GID"
image: felixlohmeier/mermaid
volumes:
- ./:/data:z
command: ["-s", "-p", "myflowchart.mdd"]
```
## typical workflow ## typical workflow
1. Create your graph in [mermaid's live editor](https://mermaidjs.github.io/mermaid-live-editor/) 1. Create your graph in [mermaid's live editor](https://mermaidjs.github.io/mermaid-live-editor/)
2. Copy & paste your graph config in a text editor and save it to a local file 2. Copy & paste your graph config in a text editor and save it to a local file
3. Download a stylesheet from <https://unpkg.com/mermaid@7.0.13/dist/themes/> (and customize it if you want) 3. Download a stylesheet from <https://unpkg.com/mermaid@7.0.13/dist/themes/> (and customize it if you want)
4. Run this docker container to create png and svg. 4. Run a docker container with this Docker image to create png and svg.
## Example ## Example
@ -29,4 +45,4 @@
* apply custom stylesheet [mermaid.neutral.css](https://unpkg.com/mermaid@7.0.13/dist/themes/mermaid.neutral.css) from local file `-t mermaid.neutral.css` * apply custom stylesheet [mermaid.neutral.css](https://unpkg.com/mermaid@7.0.13/dist/themes/mermaid.neutral.css) from local file `-t mermaid.neutral.css`
* name of local file containing graph config: `myflowchart.mmd` * name of local file containing graph config: `myflowchart.mmd`
> docker run --rm -v "$PWD":/data:z felixlohmeier/mermaid -s -p -w 600 -t mermaid.neutral.css myflowchart.mmd > docker run --rm -v "$PWD":/data:z -u "$UID:$GID" felixlohmeier/mermaid -s -p -w 600 -t mermaid.neutral.css myflowchart.mmd