From b40bab0391069919e01d206aa101926d90022034 Mon Sep 17 00:00:00 2001 From: Ryan Moon Date: Sat, 4 Apr 2026 06:56:56 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20add=20devpod=20image=20=E2=80=94=20code?= =?UTF-8?q?-server,=20Claude=20Code,=20bun,=20kubectl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build-devpod.yml | 30 ++++++++++++++++++++++++ Dockerfile.devpod | 38 +++++++++++++++++++++++++++++++ entrypoint-devpod.sh | 21 +++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 .gitea/workflows/build-devpod.yml create mode 100644 Dockerfile.devpod create mode 100644 entrypoint-devpod.sh diff --git a/.gitea/workflows/build-devpod.yml b/.gitea/workflows/build-devpod.yml new file mode 100644 index 0000000..35f3a22 --- /dev/null +++ b/.gitea/workflows/build-devpod.yml @@ -0,0 +1,30 @@ +name: Build Devpod + +on: + push: + branches: [main] + paths: + - Dockerfile.devpod + - entrypoint-devpod.sh + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + env: + REGISTRY: registry.digitalocean.com/lunarfront + DOCKER_HOST: tcp://localhost:2375 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to DOCR + run: echo "${{ secrets.DOCR_TOKEN }}" | docker login registry.digitalocean.com -u token --password-stdin + + - name: Build and push devpod + run: | + docker build \ + -t $REGISTRY/lunarfront-devpod:latest \ + -f Dockerfile.devpod . + docker push $REGISTRY/lunarfront-devpod:latest diff --git a/Dockerfile.devpod b/Dockerfile.devpod new file mode 100644 index 0000000..4d7be71 --- /dev/null +++ b/Dockerfile.devpod @@ -0,0 +1,38 @@ +FROM ubuntu:24.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV HOME=/root +ENV PATH="/root/.bun/bin:$PATH" + +# Base tools +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl wget git openssh-server ca-certificates gnupg \ + build-essential unzip jq tmux zsh ripgrep \ + && rm -rf /var/lib/apt/lists/* + +# Bun +RUN curl -fsSL https://bun.sh/install | bash + +# Claude Code CLI +RUN curl -fsSL https://claude.ai/install.sh | bash + +# code-server (VS Code in browser) +RUN curl -fsSL https://code-server.dev/install.sh | sh + +# kubectl +RUN curl -fsSL "https://dl.k8s.io/release/$(curl -fsSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ + -o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl + +# doctl +RUN curl -fsSL https://github.com/digitalocean/doctl/releases/download/v1.119.0/doctl-1.119.0-linux-amd64.tar.gz \ + | tar xz -C /usr/local/bin + +# SSH setup — host keys generated at runtime via entrypoint +RUN mkdir -p /run/sshd /root/.ssh && chmod 700 /root/.ssh + +COPY entrypoint-devpod.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +WORKDIR /workspace +EXPOSE 8080 22 +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint-devpod.sh b/entrypoint-devpod.sh new file mode 100644 index 0000000..3ae310b --- /dev/null +++ b/entrypoint-devpod.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +# Generate SSH host keys if not present +ssh-keygen -A + +# Write authorized keys from env if provided +if [ -n "$SSH_AUTHORIZED_KEYS" ]; then + echo "$SSH_AUTHORIZED_KEYS" > /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys +fi + +# Start SSH daemon +/usr/sbin/sshd + +# Start code-server +exec code-server \ + --bind-addr 0.0.0.0:8080 \ + --auth password \ + --disable-telemetry \ + /workspace