Devex allows users to spin up containerized REPL environments using predefined templates. To contribute your own starter template, follow the steps below.
๐ Before You Begin
Make sure to read the Contribution Guide at the root of the repo before proceeding.
๐ Steps to Add a New Template
โ Step 1: Add Template Folder in templates/
โข
Create a new folder inside templates/.
โข
This folder name will act as the template key and must:
โขBe unique.
โขBe URL-friendly (use - instead of spaces).
โขMatch exactly across all usages (templates, runner, web, core).
โขBe below 8MB in size.
Example: For a template named node, create templates/node/.
โ๏ธ Step 2: Add a Dockerfile in runner/
โขCreate a Dockerfile in runner/ named <template-key>.dockerfile.
Example: For a node template:
Create runner/node.dockerfile
๐ง Sample Dockerfile
Dockerfile
# ---- Step 1: Build Stage ----
FROM golang:1.24 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod tidy
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o runner ./cmd/main.go
# ---- Step 2: Final Runtime Stage ----
FROM node:20-slim
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash \
curl \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g nodemon typescript ts-node
RUN curl -sS https://starship.rs/install.sh | sh -s -- -y && \
echo 'eval "$(starship init bash)"' >> /root/.bashrc
COPY --from=builder /app/runner .
EXPOSE 8080
CMD ["/app/runner"]
๐ซ Note: Do not modify the Go runner source code.
๐ก Add any static files needed by your template inside templates/<template-key>/.
๐ง Step 3: Register the Template in the Web UI
Edit web/libs/templates.tsx and register your new template: