Build PlantUML environment with VSCode + Docker

background

Recently, I was told that it was getting harder to write sequences with the gui drawing tool while I was working, so I decided to code it with PlantUML. At that time, there were some people who could build the environment smoothly and some who couldn't, so I wondered if it would be easy to build the environment with docker. The files written in the article are published on Github.

Premise

It is a prerequisite machine environment

--You can use docker --docker-compose can be used --VSCode is installed

things to do

The Docker image of PlantUML Server has been released, so I will use that. Change the VS Code extension settings to render using the PlantUML Server started locally.

1. Create docker-compose.yml

It is troublesome to specify the port every time and `` docker run```, and I want to make post-processing easy, so I will make it possible to start and end with docker-compose. Create an appropriate directory and place the following docker-compose.yml` file.

docker-compose.yml


version: '3'
services:
  plantuml-server:
    image: plantuml/plantuml-server
    container_name: plantuml-local-server
    ports:
      - "8080:8080"

2. VS Code settings

--Install extension PlantUML --Set the following from the Extension settings of the installed PlantUML

That's all for the settings.

How to use

When you want to draw a diagram with plantuml, move to the directory where docker-compose.yml is placed and then start plantuml-server as follows.

$ docker-compose up -d

Create a pu file with VS Code. The location of the file is arbitrary.

sample.pu


@startuml sample
alice -> Bob: Hello, Bob!
alice <-- Bob: Hello, Alice!
@enduml

Open the VS Code command palette (ctrl + shift + p for windows command + shift + p for mac) Select PlantUML: Preview Current Diagram to see the preview. If you edit the file as it is, the preview will be updated as well.

When you finish

$ docker-compose down

Is OK.

Reference information

Easy to build UML explosive preview environment with Visual Studio Code + PlantUML Server on Docker

Recommended Posts

Build PlantUML environment with VSCode + Docker
Build docker environment with WSL
Build a Laravel / Docker environment with VSCode devcontainer
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Build environment with vue.js + rails + docker
Build Rails environment with Docker Compose
Build docker + laravel environment with laradock
Build a PureScript development environment with Docker
Build a Wordpress development environment with Docker
[Docker] Build Jupyter Lab execution environment with Docker
Build an environment with Docker on AWS
Build TensorFlow operation check environment with Docker
How to build Rails 6 environment with Docker
Build Go development environment with WSL2 + Docker Desktop + VSCode (Remote --Containers)
I tried to build the environment of PlantUML Server with Docker
Build a WordPress development environment quickly with Docker
Build a development environment for Docker, java, vscode
Build mecab (NEologd dictionary) environment with Docker (ubuntu)
[Rails] How to build an environment with Docker
[First team development ②] Build an environment with Docker
Pytorch execution environment with Docker
WSL2 + VSCode + Docker development environment
[Docker] Rails 5.2 environment construction with docker
React environment construction with Docker
Build DynamoDB local with Docker
Using PlantUml with Honkit [Docker]
How to build docker environment with Gradle for intelliJ
Build an environment of Ruby2.7.x + Rails6.0.x + MySQL8.0.x with Docker
Easily build a Vue.js environment with Docker + Vue CLI
[Note] Build a Python3 environment with Docker in EC2
Build Java development environment with WSL2 Docker VS Code
Build Rails (API) x MySQL x Nuxt.js environment with Docker
Build WordPress environment with Docker (Local) and AWS (Production)
Debug the VSCode + Docker + PHP development environment with XDebug.
Create Chisel development environment with Windows10 + WSL2 + VScode + Docker
Rails + MySQL environment construction with Docker
Create a Vue3 environment with Docker!
Build a Tomcat 8.5 environment with Pleiades 4.8
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
Create SolrCloud verification environment with Docker
Build Clang x VSCode on Docker (1)
Create Laravel environment with Docker (docker-compose)
Build jooby development environment with Eclipse
How to build Rails, Postgres, ElasticSearch development environment with Docker
Build a Node-RED environment with Docker to move and understand
I tried to build the environment of WSL2 + Docker + VSCode
[Environment construction with Docker] Rails 6 & MySQL 8
Build Unity development environment on docker
Build WebRTC Janus with Docker container
Spring Boot gradle build with Docker
Build apache7.4 + mysql8 environment with Docker (with initial data) (your own memo)
Ruby on Rails development environment construction with Docker + VSCode (Remote Container)
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ MySQL edition ~
Build an ASP.net Core Web API environment on Docker (VSCode) Part 1
Build an ASP.NET Core Web API environment on Docker (VSCode) Part 2
How to build Rails + Vue + MySQL environment with Docker [2020/09 latest version]
Build a development environment for Django + MySQL + nginx with Docker Compose
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Sequelize ~
Alert slack with alert manager in Docker environment
GPU environment construction with Docker [October 2020 version]