d2-playground
d2-playground copied to clipboard
[FEATURE REQUEST] Could we get a docker image?
It would be nice to have a docker image for self-hosting.
@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:
@alixander can you publish the image yourself to the Docker Hub registry and include instructions for running it in the README?