diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c56a87..d1013f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,7 @@ jobs: - name: Copy Template run: | uvx copier copy \ + --vcs-ref HEAD \ ./ \ /tmp/test-copier \ -d project_name=test-copier \ diff --git a/template/.devcontainer/Dockerfile b/template/.devcontainer/Dockerfile new file mode 100644 index 0000000..ead3dd3 --- /dev/null +++ b/template/.devcontainer/Dockerfile @@ -0,0 +1,24 @@ +# syntax=docker/dockerfile:1 + +FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 + +RUN rm -f /etc/apt/apt.conf.d/docker-clean \ + && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + apt-get update \ + && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + curl \ + fd-find \ + git \ + jq \ + ripgrep \ + wget \ + && curl -fsSL https://github.com/openai/codex/releases/latest/download/install.sh -o /tmp/install-codex.sh \ + && CODEX_INSTALL_DIR=/usr/local/bin \ + CODEX_HOME=/opt/codex \ + CODEX_NON_INTERACTIVE=1 \ + sh /tmp/install-codex.sh \ + && rm -f /tmp/install-codex.sh diff --git a/template/.devcontainer/devcontainer.json b/template/.devcontainer/devcontainer.json index 850173d..957260a 100644 --- a/template/.devcontainer/devcontainer.json +++ b/template/.devcontainer/devcontainer.json @@ -1,6 +1,9 @@ { "name": "python-devcontainer", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, "containerEnv": { "DISPLAY": "${localEnv:DISPLAY}", "PYTHONUNBUFFERED": "1", @@ -17,13 +20,9 @@ "ghcr.io/devcontainers/features/common-utils:2": { "configureZshAsDefaultShell": true }, - "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { - "packages": "curl,wget,git,jq,ca-certificates,build-essential,ripgrep,fd-find" - }, "ghcr.io/va-h/devcontainers-features/uv:1": { "shellAutocompletion": true }, - "ghcr.io/devcontainers/features/node:1": {}, "ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {} }, "runArgs": [ @@ -50,14 +49,13 @@ }, "remoteUser": "vscode", "containerUser": "vscode", - "initializeCommand": "mkdir -p ${localEnv:HOME}/.claude ${localEnv:HOME}/.codex && touch ${localEnv:HOME}/.claude/CLAUDE.md ${localEnv:HOME}/.codex/config.toml", + "initializeCommand": "mkdir -p ${localEnv:HOME}/.claude ${localEnv:HOME}/.codex", "mounts": [ "source=shell_history-${devcontainerId},target=/shell_history,type=volume", + "source=uv-cache-${devcontainerId},target=/home/vscode/.cache/uv,type=volume", "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind", - "source=${localEnv:HOME}/.claude/CLAUDE.md,target=/home/vscode/.claude/CLAUDE.md,type=bind", - "source=${localEnv:HOME}/.codex,target=/home/vscode/.codex,type=bind", - "source=${localEnv:HOME}/.codex/config.toml,target=/home/vscode/.codex/config.toml,type=bind" + "source=${localEnv:HOME}/.codex,target=/home/vscode/.codex,type=bind" ], - "postCreateCommand": "npm install -g @openai/codex@latest && uv sync --locked", + "postCreateCommand": "sudo chown -R vscode:vscode /home/vscode/.cache && uv sync --locked", "postStartCommand": "uv run pre-commit install" } diff --git a/template/CLAUDE.md b/template/CLAUDE.md deleted file mode 120000 index 47dc3e3..0000000 --- a/template/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AGENTS.md \ No newline at end of file diff --git a/template/CLAUDE.md b/template/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md