Skip to content

Commit 33986eb

Browse files
committed
chore: add devcontainer configuration and post-create setup script
1 parent b5b656b commit 33986eb

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3+
{
4+
"name": "Ubuntu",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/base:noble",
7+
"features": {
8+
"ghcr.io/devcontainers/features/dotnet:2": {},
9+
"ghcr.io/devcontainers/features/github-cli:1": {},
10+
"ghcr.io/devcontainers/features/node:1": {},
11+
"ghcr.io/va-h/devcontainers-features/uv:1": {},
12+
"ghcr.io/devcontainers-extra/features/direnv:1": {},
13+
"ghcr.io/devcontainers-extra/features/tmux-apt-get:1": {}
14+
},
15+
// Use 'postCreateCommand' to run commands after the container is created.
16+
"postCreateCommand": "bash .devcontainer/post-create.sh",
17+
// Mount the host's Claude configuration directory
18+
"mounts": [
19+
"source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind,consistency=consistent"
20+
]
21+
// Features to add to the dev container. More info: https://containers.dev/features.
22+
// "features": {},
23+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
24+
// "forwardPorts": [],
25+
// Use 'postCreateCommand' to run commands after the container is created.
26+
// "postCreateCommand": "uname -a",
27+
// Configure tool-specific properties.
28+
// "customizations": {},
29+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
30+
// "remoteUser": "root"
31+
}

β€Ž.devcontainer/post-create.shβ€Ž

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Post-creation script for TrendWeight devcontainer
4+
set -e
5+
6+
echo "πŸš€ Running post-create setup..."
7+
8+
# Install Ruby (needed for tmuxinator)
9+
echo "πŸ“¦ Installing Ruby..."
10+
sudo apt-get update
11+
sudo apt-get install -y ruby ruby-dev
12+
13+
# Install tmuxinator
14+
echo "πŸ“¦ Installing tmuxinator..."
15+
sudo gem install tmuxinator
16+
17+
# Create tmuxinator config directory
18+
echo "πŸ“ Setting up tmuxinator config directory..."
19+
mkdir -p ~/.config/tmuxinator
20+
21+
# Install Claude Code
22+
echo "πŸ“¦ Installing Claude Code..."
23+
npm install -g @anthropic-ai/claude-code
24+
25+
# Setup direnv shell integration
26+
echo "πŸ”§ Setting up direnv shell integration..."
27+
# Add direnv hook to bash profile
28+
if ! grep -q "direnv hook bash" ~/.bashrc; then
29+
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
30+
fi
31+
# Add direnv hook to zsh profile (if zsh is available)
32+
if command -v zsh >/dev/null 2>&1 && [ -f ~/.zshrc ]; then
33+
if ! grep -q "direnv hook zsh" ~/.zshrc; then
34+
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
35+
fi
36+
fi
37+
38+
echo "βœ… Post-create setup completed!"

0 commit comments

Comments
Β (0)