refactor: rename and improve devcontainer

Signed-off-by: bullshit <coding@ow-software.pl>
This commit is contained in:
bullshit committed 2025-08-08 17:46:32 +02:00
1 parent 6696c79fdc
commit e037757261
3 files changed
+14 -11

No files matched your search

+9 -2
View File
@@ -5,10 +5,17 @@ FROM ghcr.io/esphome/esphome:latest
ARG USERNAME=esphome ARG USERNAME=esphome
ARG USER_UID=1000 ARG USER_UID=1000
ARG USER_GID=$USER_UID ARG USER_GID=$USER_UID
ENV REMOTE_USERNAME=$USERNAME
# Update and install packages
RUN apt-get update \
&& apt-get install -y \
usbutils libusb-1.0-0-dev libudev-dev build-essential cmake ninja-build \
git wget curl tree vim nano htop tmux screen jq socat minicom picocom \
udev sudo dialog npm nut-client
RUN groupadd --gid $USER_GID $USERNAME \ RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
&& apt-get update && apt-get install -y sudo dialog \
&& usermod -aG dialout,plugdev $USERNAME \ && usermod -aG dialout,plugdev $USERNAME \
&& echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME \ && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME && chmod 0440 /etc/sudoers.d/$USERNAME
+1 -1
View File
@@ -10,7 +10,7 @@
"version": "3.11", "version": "3.11",
"installTools": true "installTools": true
}, },
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5": {} // "ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5": {}
}, },
"mounts": [ "mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
+4 -8
View File
@@ -3,12 +3,6 @@ set -e
echo "🚀 Setting up ESPHome Component Development Environment..." echo "🚀 Setting up ESPHome Component Development Environment..."
# Update and install packages
apt-get update
apt-get install -y \
usbutils libusb-1.0-0-dev libudev-dev build-essential cmake ninja-build \
git wget curl tree vim nano htop tmux screen jq socat minicom picocom udev
# Install Python tools # Install Python tools
pip install --upgrade pip black flake8 pylint mypy pytest jupyter ipython platformio pip install --upgrade pip black flake8 pylint mypy pytest jupyter ipython platformio
@@ -16,7 +10,8 @@ pip install --upgrade pip black flake8 pylint mypy pytest jupyter ipython platfo
pip install --upgrade esphome pip install --upgrade esphome
# Claude Code - MCP server # Claude Code - MCP server
claude mcp add code npx "@steipete/claude-code-mcp" "/workspace" sudo -u esphome bash -c "curl -fsSL https://claude.ai/install.sh | bash -s latest"
sudo -u esphome bash -c "~/.local/bin/claude mcp add code npx \"@steipete/claude-code-mcp\" \"/workspace\""
# Set up USB permissions # Set up USB permissions
cat > /etc/udev/rules.d/99-esphome-usb.rules << 'UDEV_EOF' cat > /etc/udev/rules.d/99-esphome-usb.rules << 'UDEV_EOF'
@@ -37,7 +32,8 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="09d6", MODE="0666"
UDEV_EOF UDEV_EOF
# Create aliases # Create aliases
cat >> ~/.bashrc << 'BASH_EOF' cat >> /home/esphome/.bashrc << BASH_EOF
export PATH=~/.local/bin/:\$PATH
alias esphome-config='esphome config' alias esphome-config='esphome config'
alias esphome-compile='esphome compile' alias esphome-compile='esphome compile'
alias esphome-upload='esphome upload' alias esphome-upload='esphome upload'