Skip to content

Commit 57cda77

Browse files
authored
refactor: update devcontainer to use template's pre-built image (#144)
1 parent e5ff0a4 commit 57cda77

4 files changed

Lines changed: 38 additions & 20 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "template",
3-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4-
"features": {
5-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
6-
"ghcr.io/devcontainers-extra/features/mise:1": {},
7-
"ghcr.io/devcontainers/features/node:1": {
8-
"version": "lts"
9-
}
10-
},
3+
"image": "ghcr.io/fx/docker/devcontainer:latest",
114
"containerUser": "vscode",
12-
"postCreateCommand": "bash .devcontainer/install-deps.sh"
5+
"postStartCommand": "bash .devcontainer/post-start-wrapper.sh",
6+
"mounts": [
7+
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
8+
],
9+
"runArgs": [
10+
"--privileged"
11+
]
1312
}

.devcontainer/install-deps.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Log script execution for debugging
5+
echo "Running post-start script: $(date)" >> /tmp/post-start.log
6+
exec > >(tee -a /tmp/post-start.log)
7+
exec 2>&1
8+
9+
bash .devcontainer/post-start.sh

.devcontainer/post-start.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+
# Trust the workspace folder
5+
mise trust
6+
7+
# Install tools via mise
8+
echo "Installing tools via mise..."
9+
mise install -y
10+
11+
# Install Claude Code globally
12+
echo "Installing Claude Code..."
13+
npm install -g @anthropic-ai/claude-code
14+
15+
# Install npm dependencies if package.json exists
16+
if [ -f "package.json" ]; then
17+
echo "Installing npm dependencies..."
18+
npm install
19+
fi
20+
21+
echo "Post-start script completed successfully"

0 commit comments

Comments
 (0)