d2-playground icon indicating copy to clipboard operation
d2-playground copied to clipboard

[FEATURE REQUEST] Could we get a docker image?

Open deoxykev opened this issue 1 year ago • 1 comments

It would be nice to have a docker image for self-hosting.

deoxykev avatar Jan 04 '24 01:01 deoxykev

@deoxykev you can build it yourself using a Dockerfile:

FROM golang:1.21-alpine
RUN apk add --no-cache \
    git \
    nodejs \
    npm

WORKDIR /app
RUN git clone https://github.com/terrastruct/d2-playground.git .
RUN git submodule update --init --recursive

RUN npm install -g esbuild yarn
WORKDIR /app/src/js
RUN yarn

WORKDIR /app
RUN go mod download

ENTRYPOINT ["go", "run", "main.go"]

Use the following commands to run it:

docker build -t d2-playground . and docker run -d -p 9090:9090 --name d2-playground d2-playground

I just tested it myself:

Image

@alixander can you publish the image yourself to the Docker Hub registry and include instructions for running it in the README?

Lifailon avatar Oct 08 '25 12:10 Lifailon