Skip to content

Commit d14d1c7

Browse files
committed
Add dev container config
1 parent cb50648 commit d14d1c7

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM mcr.microsoft.com/devcontainers/java:25
2+
3+
# Install essential tools
4+
RUN apt-get update && \
5+
apt-get install -y vim curl wget git jq && \
6+
apt-get clean && \
7+
rm -rf /var/lib/apt/lists/*
8+
9+
# Install sbt
10+
RUN curl -fL "https://github.com/sbt/sbt/releases/download/v1.12.0/sbt-1.12.0.tgz" | tar xz -C /tmp && \
11+
mv /tmp/sbt/bin/sbt /usr/local/bin/ && \
12+
mv /tmp/sbt/bin/sbt-launch.jar /usr/local/bin/ && \
13+
chmod +x /usr/local/bin/sbt && \
14+
rm -rf /tmp/sbt

.devcontainer/devcontainer.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "tapir",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/node:1": {
8+
"version": "24"
9+
},
10+
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {},
11+
"ghcr.io/devcontainers/features/github-cli:1": {
12+
"installDirectlyFromGitHubRelease": true,
13+
"version": "latest"
14+
}
15+
},
16+
"customizations": {
17+
"vscode": {
18+
"extensions": [
19+
"anthropic.claude-code",
20+
"scalameta.metals",
21+
"scala-lang.scala",
22+
"github.vscode-pull-request-github"
23+
],
24+
"settings": {
25+
"terminal.integrated.defaultProfile.linux": "bash",
26+
"claudeCode.allowDangerouslySkipPermissions": true,
27+
"claudeCode.initialPermissionMode": "bypassPermissions",
28+
"claudeCode.selectedModel": "opus"
29+
}
30+
}
31+
},
32+
"postCreateCommand": "bash .devcontainer/post-create.sh",
33+
"postStartCommand": "bash .devcontainer/post-start.sh",
34+
"mounts": [
35+
"type=volume,source=tapir-vscode-home,target=/home/vscode",
36+
"type=bind,source=${localEnv:HOME}/.claude/CLAUDE.md,target=/home/vscode/.claude/CLAUDE.md,readonly",
37+
"type=bind,source=${localEnv:HOME}/.claude/commands,target=/home/vscode/.claude/commands,readonly",
38+
"type=bind,source=${localEnv:HOME}/.claude/agents,target=/home/vscode/.claude/agents,readonly"
39+
],
40+
"containerEnv": {
41+
"SSH_AUTH_SOCK": ""
42+
},
43+
"runArgs": [
44+
"--env-file=${localWorkspaceFolder}/../dev-container-oss.env"
45+
]
46+
}

.devcontainer/post-create.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Running post-create setup..."
5+
6+
# Override git config with environment variables if provided
7+
if [ -n "$GIT_USER_NAME" ]; then
8+
git config --global user.name "$GIT_USER_NAME"
9+
fi
10+
if [ -n "$GIT_USER_EMAIL" ]; then
11+
git config --global user.email "$GIT_USER_EMAIL"
12+
fi
13+
14+
# Add claude-yolo alias
15+
echo 'alias claude-yolo="claude --dangerously-skip-permissions"' >> ~/.bashrc
16+
17+
# Ensure mounted directories exist & fix ownership (Docker volumes are created as root)
18+
mkdir -p /home/vscode/.claude
19+
sudo chown -R vscode:vscode /home/vscode/.claude 2>/dev/null || true
20+
21+
echo "Post-create setup complete."

.devcontainer/post-start.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -e
3+
4+
sudo env PATH="$PATH" claude update

0 commit comments

Comments
 (0)