Sign inSign up

samuelsantos/generate-diagrams-as-code

By samuelsantos

•Updated about 6 years ago

This is a non official Git image from repo of the Diagrams

Image
1

338

samuelsantos/generate-diagrams-as-code repository overview

⁠Docker Diagrams as Code

Docker Cloud Automated build

This is a non official Git image from repo of the Diagram as code⁠ that is mainteined for MinJae Kwon⁠ and all credits are for him that made this greate job.

This image was created to keep your machine more clean and Docker become to make it easy.

⁠Getting Started

⁠Requires
⁠Pull image Diagram as Code
docker pull samuelsantos/generate-diagrams-as-code
⁠Enviroment variables
VariableDefaultDescription
DIAGRAM_FILEThis variable represents the name of the python file that you create to generate a diagram. Remember to define a volume :/data, your diagram you be generate inside this volume and your python diagram needs to be inside this folder volume.
⁠Create a diagram

Original source Diagrams⁠.

# !/diagram.py
# https://diagrams.mingrammer.com/docs/getting-started/examples

from diagrams import Cluster, Diagram
from diagrams.aws.compute import ECS
from diagrams.aws.database import ElastiCache, RDS
from diagrams.aws.network import ELB
from diagrams.aws.network import Route53

with Diagram("Clustered Web Services", show=False):
    dns = Route53("dns")
    lb = ELB("lb")

    with Cluster("Services"):
        svc_group = [ECS("web1"),
                    ECS("web2"),
                    ECS("web3")]

    with Cluster("DB Cluster"):
        db_master = RDS("userdb")
        db_master - [RDS("userdb ro")]

    memcached = ElastiCache("memcached")

    dns >> lb >> svc_group
    svc_group >> db_master
    svc_group >> memcached

⁠Generate diagram through docker

Remember your path needs to be shared with docker.

├─ ~
├── diagrams
│   └── diagram.py
docker run --rm -t -v ~/diagrams:/data -e DIAGRAM_FILE=diagram.py --name diagrams samuelsantos/generate-diagrams-as-code

⁠Contributing

⁠License

MIT⁠

Tag summary

Content type

Image

Digest

Size

123.4 MB

Last updated

about 6 years ago

docker pull samuelsantos/generate-diagrams-as-code