Skip to content

BurtHarris/dogeTech

Repository files navigation

πŸš€ DogeTech: Dev Containers for Windows Developers

Harness the power of VS Code Dev Containers on Windows! A safe, isolated Node.js/TypeScript environment for GitHub Copilot experiments.

🎯 For Windows Developers: Experience the magic of containerized development without leaving your familiar Windows + VS Code workflow. Edit files on Windows, run code in Linux containers - get the best of both worlds!

πŸ’» Why Dev Containers + Windows?

The Problem: Installing development tools directly on Windows can be messy, version conflicts arise, and experimental tools can clutter your system.

The Solution: Dev Containers let you run a complete Linux development environment inside Docker while keeping your familiar Windows editing experience in VS Code.

🌟 Perfect for Windows Developers Who Want To:

  • βœ… Experiment safely - Try new tools without cluttering Windows
  • βœ… Avoid "dependency hell" - Each project gets its own isolated environment
  • βœ… Keep familiar workflow - Edit in VS Code on Windows, run in Linux container
  • βœ… Share identical setups - No more "works on my machine" problems
  • βœ… Use GitHub Copilot effectively - Pre-configured AI development environmentogeTech Experimental Dev Environment

A safe, isolated development environment for GitHub Copilot experiments using VS Code Dev Containers.

🎯 Purpose: Containerized Node.js/TypeScript environment that protects your host machine while providing a consistent, AI-enhanced development experience. Perfect for experimenting with new tools, learning, and rapid prototyping.

⚑ Quick Start (5 minutes)

Prerequisites (Windows 10/11)

Setup

  1. Clone with PowerShell/Command Prompt:

    git clone https://github.com/BurtHarris/dogeTech.git
    cd dogeTech
    code .
  2. Let VS Code do the magic:

    • VS Code detects the Dev Container config β†’ "Reopen in Container"
    • Click it and watch Docker + VS Code create your Linux development environment!
    • OR manually: Ctrl+Shift+P β†’ "Dev Containers: Reopen in Container"
  3. Enjoy the best of both worlds:

    • Edit files: Normal VS Code experience on Windows
    • Run commands: PowerShell terminal inside Ubuntu Linux container
    • Debug & IntelliSense: Works seamlessly across the boundary
    • GitHub Copilot: Pre-configured and ready for AI-assisted coding

🎯 What You Get (Windows Developer Benefits)

  • βœ… Safe Isolation: Linux container protects your Windows system
  • βœ… Familiar VS Code: Same editor, same extensions, same shortcuts
  • βœ… PowerShell in Linux: Windows-friendly terminal inside Ubuntu container
  • βœ… No Windows PATH pollution: Tools stay in container, Windows stays clean
  • βœ… GitHub Copilot: Pre-configured for AI-enhanced development
  • βœ… Hot Reload: Edit on Windows, see changes instantly in container
  • βœ… Cross-platform consistency: Same Linux environment on any Windows machine
  • βœ… Easy cleanup: Delete container to remove all traces

πŸ”₯ The Windows Dev Container Advantage

Traditional Windows Development Problems:

❌ Installing Node.js, Python, databases clutters system PATH
❌ Version conflicts between projects (Node 14 vs Node 20)  
❌ Experimental tools leave traces even after uninstall
❌ "Works on my machine" - different setups across team
❌ Fear of breaking system when trying new tools

With Dev Containers on Windows:

βœ… Each project gets isolated Linux environment
βœ… Switch between Node versions instantly (different containers)
βœ… Experiment fearlessly - delete container to reset completely  
βœ… Identical team environments - share container configuration
βœ… Keep Windows clean - all dev tools contained

Real Example:

# Want to try Python data science? No problem!
# Add to Dockerfile: RUN pip install pandas jupyter tensorflow
# Rebuild container - Python tools available instantly
# Delete container later - zero traces on Windows

Result: Professional Linux-based development workflow while staying in your comfortable Windows environment!

🀝 Sharing with Your Team

For Your Apprentice

  1. Push this repository to GitHub
  2. Share the repository URL
  3. She follows APPRENTICE_SETUP.md
  4. Identical environment automatically created

Collaboration Workflow

# You make improvements:
git add . && git commit -m "Added Python support" && git push

# She gets updates:
git pull
# In VS Code: Ctrl+Shift+P β†’ "Dev Containers: Rebuild Container"

Result: Both of you have identical experimental environments that stay in sync!

Essential Commands

# Install dependencies (run once)
npm install

# Setup GitHub secrets (secure token storage)
npm run secrets:setup

# Start development environment with hot reload
npm run docker:dev

# Start production environment
npm run docker:prod

# Get interactive shell access to running container
npm run docker:shell

# Setup GitHub CLI and Copilot CLI authentication
npm run github:setup

# Rebuild Docker containers (after Dockerfile changes)
npm run docker:build

# Build TypeScript locally
npm run build

# Stop all containers
docker-compose down

Testing & Validation

# Quick test - Core functionality (no secrets required)
npm run test:quick

# Full smoke test - Complete integration test with secrets
npm run test:smoke

# Smoke test (Linux/Mac)
npm run test:smoke:bash

What's Included

This dockerized development environment provides:

  • πŸ”„ Hot Reload: Automatic restart on file changes with ts-node-dev
  • πŸ› Remote Debugging: Debug port exposed on 9229 for VS Code
  • πŸ€– GitHub Copilot CLI: Pre-installed with command suggestions and explanations
  • οΏ½ VS Code Integration: Dev Containers support with extensions pre-configured
  • οΏ½πŸ“¦ Multi-stage Builds: Separate optimized development and production containers
  • πŸ› οΈ Development Tools: Git, GitHub CLI, vim, nano, htop, curl pre-installed
  • πŸ” Full TypeScript Support: Configured with proper types and compilation
  • 🐳 Docker Compose: Easy container orchestration for dev/prod environments
  • πŸ“ Volume Mounting: Live code editing without container rebuilds
  • 🌐 API Ready: Sample HTTP server listening on port 3000

Container Specifications

Development Container (app-dev)

  • Base: Node.js 20 LTS (slim)
  • Tools: Git, GitHub CLI, vim, nano, htop, curl, procps
  • AI: GitHub Copilot CLI with command suggestions
  • TypeScript: Hot reload with ts-node-dev
  • Debugging: Port 9229 exposed for remote debugging
  • Volumes: Live code mounting with node_modules isolation, SSH keys, GitHub config
  • Environment: NODE_ENV=development

Production Container (app-prod)

  • Base: Node.js 20 LTS (slim)
  • Optimized: Multi-stage build with only production dependencies
  • Compiled: Pre-built TypeScript to JavaScript
  • Environment: NODE_ENV=production

Debugging with VS Code

  1. Start development container: npm run docker:dev
  2. In VS Code, go to Run & Debug (Ctrl+Shift+D)
  3. Create launch configuration:
    {
      "type": "node",
      "request": "attach",
      "name": "Docker Debug",
      "port": 9229,
      "restart": true,
      "remoteRoot": "/usr/src/app"
    }
  4. Set breakpoints and start debugging!

GitHub Copilot CLI Setup

The container comes with GitHub Copilot CLI for AI-powered command assistance, with secure secret management.

Quick Setup (Recommended)

  1. Setup secrets: npm run secrets:setup (creates secure token files)
  2. Start container: npm run docker:dev
  3. Run setup script: npm run github:setup
  4. Authenticate: Follow prompts to complete GitHub authentication

Manual Setup

# Get shell access
npm run docker:shell

# Authenticate GitHub CLI
gh auth login

# Authenticate Copilot CLI
github-copilot-cli auth

Usage Examples

# Get command suggestions
github-copilot-cli suggest "find all typescript files"

# Explain a command
github-copilot-cli what-the-shell "find . -name '*.ts' -type f"

# Git assistance
github-copilot-cli git-assist "commit all changes with message"

# Short aliases (available after setup)
copilot suggest "deploy to production"
?? "what does this command do: docker ps -a"
git? "create a new branch"

Configuration

Environment Variables

  • NODE_ENV: development or production
  • PORT: Application port (default: 3000)
  • DEBUG: Debug namespaces for enhanced logging

Docker Secrets (Secure Token Storage)

GitHub tokens are stored as Docker secrets for enhanced security:

# Setup secrets interactively (Windows)
npm run secrets:setup

# Setup secrets interactively (Linux/Mac)
npm run secrets:setup:bash

# Manual setup
echo "your_token_here" > secrets/github_token.txt
echo "your_token_here" > secrets/gh_token.txt
chmod 600 secrets/*.txt

Security Benefits over .env files:

  • βœ… Tokens stored as files, not environment variables
  • βœ… Mounted as temporary filesystems (tmpfs)
  • βœ… Never exposed in docker inspect or process lists
  • βœ… Automatic cleanup when container stops
  • βœ… Restricted file permissions (600)
  • βœ… Not visible in container environment variables
  • βœ… Harder to accidentally leak in logs or dumps

Access inside container:

# Secrets are available at /run/secrets/
cat /run/secrets/github_token
cat /run/secrets/gh_token

Testing & Validation

The environment includes comprehensive automated tests to validate functionality:

Quick Test (npm run test:quick)

  • βœ… Container builds successfully
  • βœ… API server starts and responds
  • βœ… TypeScript compilation works
  • βœ… Basic shell functionality
  • ⏱️ Duration: ~2-3 minutes
  • πŸ”“ No secrets required

Smoke Test (npm run test:smoke)

  • βœ… All Quick Test validations
  • βœ… Docker secrets mounting and accessibility
  • βœ… GitHub token security validation
  • βœ… Container tools availability (git, curl, vim, etc.)
  • βœ… Node.js version verification
  • βœ… Development environment integration
  • ⏱️ Duration: ~3-4 minutes
  • πŸ” Creates test secrets automatically

Both tests include automatic cleanup and detailed pass/fail reporting.

Ports

  • 3000: Application HTTP server
  • 9229: Node.js debug/inspector port

Project Structure

dogetech-dev-env/
β”œβ”€β”€ .devcontainer/
β”‚   └── devcontainer.json           # VS Code Dev Container configuration
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ github-setup.sh             # GitHub CLI and Copilot setup script
β”‚   β”œβ”€β”€ setup-secrets.sh            # Docker secrets setup (Linux/Mac)
β”‚   β”œβ”€β”€ setup-secrets.ps1           # Docker secrets setup (Windows)
β”‚   β”œβ”€β”€ smoke-test.sh               # Comprehensive integration test (Linux/Mac)
β”‚   β”œβ”€β”€ smoke-test.ps1              # Comprehensive integration test (Windows)
β”‚   └── quick-test.ps1              # Quick functionality test
β”œβ”€β”€ secrets/                        # Docker secrets directory
β”‚   β”œβ”€β”€ README.md                   # Secrets documentation
β”‚   β”œβ”€β”€ github_token.txt.example    # Token template
β”‚   └── gh_token.txt.example        # GitHub CLI token template
β”œβ”€β”€ src/
β”‚   └── index.ts                    # Sample TypeScript application
β”œβ”€β”€ dist/                           # Compiled JavaScript output
β”œβ”€β”€ node_modules/                   # Dependencies (gitignored)
β”œβ”€β”€ .env.example                    # Environment variables template
β”œβ”€β”€ .gitignore                      # Comprehensive ignore rules
β”œβ”€β”€ docker-compose.yml              # Container orchestration with secrets
β”œβ”€β”€ dockerfile                      # Multi-stage container definition  
β”œβ”€β”€ package.json                    # Dependencies and scripts
β”œβ”€β”€ tsconfig.json                   # TypeScript configuration
β”œβ”€β”€ docker-compose.override.example.yml  # Local development overrides
└── README.md                       # This file

Getting Started

  1. Clone or download this repository
  2. Install dependencies: npm install
  3. Start development: npm run docker:dev
  4. Access your app: Visit http://localhost:3000
  5. Start coding: Edit files in src/ and watch them reload automatically!

Use Cases

Perfect for:

  • βœ… Team Development: Consistent environment across all developers
  • βœ… CI/CD Pipelines: Reproducible builds and deployments
  • βœ… Learning Docker: Complete example with best practices
  • βœ… Microservices: Template for containerized Node.js services
  • βœ… Remote Development: Works great with VS Code Remote-Containers

Built with ❀️ for developers who want a hassle-free Docker development experience.

About

Safe, isolated experimental development environment for GitHub Copilot experiments using VS Code Dev Containers

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors